Title: Parse error: syntax error, unexpected $end, expecting T_STRING or T_VARIABLE
Last modified: August 30, 2016

---

# Parse error: syntax error, unexpected $end, expecting T_STRING or T_VARIABLE

 *  [Suyash87](https://wordpress.org/support/users/suyash87/)
 * (@suyash87)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-end-expecting-t_string-or-t_variable/)
 * I am facing this issue
    Parse error: syntax error, unexpected $end, expecting
   T_STRING or T_VARIABLE or ‘{‘ or ‘$’ in /home1/madworxx/public_html/wp-includes/
   nav-menu.php on line 720
 * see the code below
    function wp_setup_nav_menu_item( $menu_item ) { if ( isset(
   $menu_item->post_type ) ) { if ( ‘nav_menu_item’ == $menu_item->post_type ) {
   $menu_item->db_id = (int) $menu_item->ID; $menu_item->menu_item_parent = empty(
   $menu_item->menu_item_parent ) ? get_post_meta( $menu_item->ID, ‘_menu_item_menu_item_parent’,
   true ) : $menu_item->menu_item_parent; $menu_item->object_id = empty( $menu_item-
   >object_id ) ? get_post_meta( $menu_item->ID, ‘_menu_item_object_id’, true ) :
   $menu_item->
 * last line is no. 720
    even when I complete parenthesis wordpress dashboard works
   but not the website, what can be the error?

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Jeremy Pry](https://wordpress.org/support/users/jpry/)
 * (@jpry)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-end-expecting-t_string-or-t_variable/#post-6779023)
 * Hey Suyash87,
 * The problem is likely the `->` after `$menu_item` on the last line. When you 
   use the `->` operator, PHP is expecting you to reference a property name using
   a string or variable. If there’s nothing but whitespace following the `->` operator,
   that may be the reason for your error.
 * It’s worth noting at this point that you shouldn’t be modifying the core WordPress
   files directly, which includes everything in the `wp-admin/` and `wp-includes/`
   directories. Instead, you should take advantage of the [Plugin API](https://codex.wordpress.org/Plugin_API)
   to change default WordPress functionality.
 *  Thread Starter [Suyash87](https://wordpress.org/support/users/suyash87/)
 * (@suyash87)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-end-expecting-t_string-or-t_variable/#post-6779025)
 * Hello Jeremy
 * I have removed spaces already, please check [http://jdadultfamilycare.com/](http://jdadultfamilycare.com/)
 * its showing error
 *  [Jeremy Pry](https://wordpress.org/support/users/jpry/)
 * (@jpry)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-end-expecting-t_string-or-t_variable/#post-6779040)
 * Hey Suyash87,
 * If you have modified that file at all, it may be best to just delete all of the
   WordPress files and download a [fresh copy](https://wordpress.org/download/).
   That would be the quickest way to ensure you have a clean, unmodified copy of
   all of the WordPress files, and you won’t have to worry about any syntax errors
   from those files.
 *  Thread Starter [Suyash87](https://wordpress.org/support/users/suyash87/)
 * (@suyash87)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-end-expecting-t_string-or-t_variable/#post-6779049)
 * can’t do that, website has data and was working few days back
 *  [Mark Ratledge](https://wordpress.org/support/users/songdogtech/)
 * (@songdogtech)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-end-expecting-t_string-or-t_variable/#post-6779066)
 * > website has data and was working few days back…
 * Your data and content is in the _database_, not in static WordPress core files.
 * Don’t replace wp-content (where your theme and uploads are) or wp-config.php,
   but replace wp-admin and wp-includes with good copies.
 *  Thread Starter [Suyash87](https://wordpress.org/support/users/suyash87/)
 * (@suyash87)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-end-expecting-t_string-or-t_variable/#post-6779073)
 * no other way?
 *  [Mark Ratledge](https://wordpress.org/support/users/songdogtech/)
 * (@songdogtech)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-end-expecting-t_string-or-t_variable/#post-6779079)
 * Read [http://www.crimsondesigns.com/wordpress-web-design/what-is-a-database-driven-website.php](http://www.crimsondesigns.com/wordpress-web-design/what-is-a-database-driven-website.php)

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Parse error: syntax error, unexpected $end, expecting T_STRING or T_VARIABLE’
is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 3 participants
 * Last reply from: [Mark Ratledge](https://wordpress.org/support/users/songdogtech/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-end-expecting-t_string-or-t_variable/#post-6779079)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
