Title: Error.  unexpected &amp;?
Last modified: August 31, 2016

---

# Error. unexpected &?

 *  [rscully](https://wordpress.org/support/users/rscully/)
 * (@rscully)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/error-unexpected/)
 * I am trying to insert this bit of code (between the plugin’s short code) and 
   getting an error message:
 * date_default_timezone_set(‘America/New_York’);
 *  $date = new DateTime();
    $date->sub(new DateInterval(‘P1D’)); echo $date->format(‘
   j F Y’);
 * and getting this error:
 * syntax error, unexpected ‘&’ in /[MY-PATH]/wp-content/plugins/insert-php/insert_php.
   php(48) : eval()’d code on line 1
 * It works outside of WordPress, but not within. Any help would be appreciated.
   Thanks.
 * [https://wordpress.org/plugins/insert-php/](https://wordpress.org/plugins/insert-php/)

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

 *  Thread Starter [rscully](https://wordpress.org/support/users/rscully/)
 * (@rscully)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/error-unexpected/#post-7004154)
 * I did read the Dealing with Errors page, only I do not see an ampersand (&) anywhere
   in the code, and certainly not on line 1.
 *  [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * (@willbontrager)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/error-unexpected/#post-7004218)
 * Something is creating an HTML entity from one or more characters in your code.
   Perhaps the “>” character.
 * Use the Text tab, not the Visual, as code put into the Visual tab will be prettied
   up by WordPress, including creating HTML entities out of certain characters.
 * If you’re using the Text tab, then there may be a plugin or WordPress overlay(
   like Visual Composer) that’s prettying your content.
 * Will

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

The topic ‘Error. unexpected &?’ is closed to new replies.

 * ![](https://ps.w.org/insert-php/assets/icon-256x256.gif?rev=3523853)
 * [Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts](https://wordpress.org/plugins/insert-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-php/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-php/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/error-unexpected/#post-7004218)
 * Status: not resolved