Title: Fatal error version 2
Last modified: May 18, 2019

---

# Fatal error version 2

 *  Resolved [Woozy Face](https://wordpress.org/support/users/shaady4/)
 * (@shaady4)
 * [7 years ago](https://wordpress.org/support/topic/fatal-error-version-2/)
 * Hi,
 * I know that version 2 is out off support but I’ve got a fatal error after updating
   wp to 5.2 could you please issue an update?
 * Een fout van het type E_PARSE werd veroorzaakt op regelnummer 1 van het bestand/
   mnt/web406/d3/83/59422483/htdocs/sitev3/wp-content/plugins/wysija-newsletters/
   helpers/render_engine.php(600) : eval()’d code. Foutmelding: syntax error, unexpected
   end of file
 * Thanks!

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

 *  [Adrian](https://wordpress.org/support/users/adriandw/)
 * (@adriandw)
 * [7 years ago](https://wordpress.org/support/topic/fatal-error-version-2/#post-11545736)
 * I have the same error in MailPoet 2 after upgrading to WordPress 5.2.
    It’s happening
   on one site I maintain but not on another site. I suspected incompatibility with
   another plugin, but deactivating all other plugins doesn’t cure the problem.
 * I am working on upgrading to MailPoet 3 but I will need to leave MailPoet 2 activated
   so that the MailPoet 2 newsletter archive is accessible. Or is there another 
   way to view the MailPoet 2 archive?
 * This is the message I see
 *     ```
       The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.
   
       PHP ERROR:array(4) {
         ["type"]=>
         int(4)
         ["message"]=>
         string(36) "syntax error, unexpected end of file"
         ["file"]=>
         string(115) "/home/xxxxxx/public_html/web/wp-content/plugins/wysija-newsletters/helpers/render_engine.php(600) : eval()'d code"
         ["line"]=>
         int(1)
       }
       ```
   
 *  [Adrian](https://wordpress.org/support/users/adriandw/)
 * (@adriandw)
 * [7 years ago](https://wordpress.org/support/topic/fatal-error-version-2/#post-11562950)
 * I installed a debugging statement to display the variable which was causing the
   eval error.
    The line of code in render_engine.php is
 *     ```
              $eval_string = sprintf ("if (%s){\$result=true;} else {\$result=false;}", $condition);
               @eval ($eval_string);
       ```
   
 * And the value of $eval_string which gives the error is
    `if ( #image){$result
   =true;} else {$result=false;}`
 * PHP is not my speciality, but I think #image is an invalid variable name.
    I’m
   not sure how to fix the problem, though.
    -  This reply was modified 7 years ago by [Adrian](https://wordpress.org/support/users/adriandw/).
    -  This reply was modified 7 years ago by [Adrian](https://wordpress.org/support/users/adriandw/).
      Reason: correct typo
 *  [widecast](https://wordpress.org/support/users/widecast/)
 * (@widecast)
 * [7 years ago](https://wordpress.org/support/topic/fatal-error-version-2/#post-11580979)
 * I’m getting the same error.
 * Rolling back to PHP 7.2 (from 7.3) prevents the error from occurring.
 * I’ve just finished migrating one of three websites that use MailPoet to version
   3. For the other two that are still using version 2, I’ve had to roll back PHP
   to keep the sites functioning.
 * A fix for this issue would be appreciated…
 *  Thread Starter [Woozy Face](https://wordpress.org/support/users/shaady4/)
 * (@shaady4)
 * [7 years ago](https://wordpress.org/support/topic/fatal-error-version-2/#post-11605270)
 * Still no fix? Thats not very kind mailpoet team 🙁
 *  [Adrian](https://wordpress.org/support/users/adriandw/)
 * (@adriandw)
 * [7 years ago](https://wordpress.org/support/topic/fatal-error-version-2/#post-11605982)
 * Thanks [@widecast](https://wordpress.org/support/users/widecast/) for the temporary
   workaround.
    I was on PHP 7.3.5. After backing down to 7.1 or 7.2 the problem
   goes away (or is hidden).
 * I still think that fixing MailPoet 2 is the wrong approach.
    There should be 
   a way to display the MailPoet 2 newsletter archive without requiring MailPoet
   2 to be installed. Maybe some way to export the SQL table containing the MailPoet
   2 newsletters and import as normal posts which don’t require any special wysija
   CSS classes.
 *  [Wysija](https://wordpress.org/support/users/wysija/)
 * (@wysija)
 * [7 years ago](https://wordpress.org/support/topic/fatal-error-version-2/#post-11624501)
 * Hi all,
 * This is a PHP compatibility issue. MailPoet 2 will not be updated to work with
   newer PHP versions. We recommend keeping to PHP 7.1 or 7.2 if you wish to run
   MailPoet 2.
 * Thanks.
 *  [jelmerjellema](https://wordpress.org/support/users/jelmerjellema/)
 * (@jelmerjellema)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-version-2/#post-11825753)
 * The problem seems to lie in another line in /wp-content/plugins/wysija-newsletters/
   helpers/render_engine.php. The eval error mentioned by [@adriandw](https://wordpress.org/support/users/adriandw/)
   is only an effect of a failing regexp parse. This warning is the real cause:
 * `PHP Warning: preg_match_all(): Compilation failed: invalid range in character
   class at offset 11 in XXX/web/wp-content/plugins/wysija-newsletters/helpers/render_engine.
   php on line 593`
 * The problem in that line is caused by this constant at line 43 of that file:
 * `const _VAR = '([\$#])([\w-_\.]+)';`
 * In PHP 7.3, for some reason the dash in the second character class is interpreted
   as a range mark instead of a literal dash. Probably because now, you can make
   ranges between classes like \w.
 * So the fix is easy (and NOT worth the 19 dollars per site that some companies
   ask for it): change this line to
 * `const _VAR = '([\$#])([\w\-_\.]+)';`
 * And all is fine again.
 * Hope to help you all out this way.
 * Regrds, Jelmer
    -  This reply was modified 6 years, 10 months ago by [jelmerjellema](https://wordpress.org/support/users/jelmerjellema/).
      Reason: I hate code blocks with backticks. That's why
    -  This reply was modified 6 years, 10 months ago by [jelmerjellema](https://wordpress.org/support/users/jelmerjellema/).
 *  [Adrian](https://wordpress.org/support/users/adriandw/)
 * (@adriandw)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-version-2/#post-11826685)
 * Thank you [@jelmerjellema](https://wordpress.org/support/users/jelmerjellema/),
   that’s good to know.
 * I had been running my site on 7.2 to avoid the problem, so I just updated to 
   7.3 in preparation to apply your fix.
 * The level of PHP 7.3 available from my hosting provider is now 7.3.7.
 * And I have been unable to recreate the problem.
    Is it possible this was recognised
   as a compatibility bug in PHP 7.3 and is now fixed in 7.3.7? It wasn’t clear 
   from the changelog at [https://www.php.net/ChangeLog-7.php#PHP_7_3](https://www.php.net/ChangeLog-7.php#PHP_7_3)
 * Adrian
 *  [jelmerjellema](https://wordpress.org/support/users/jelmerjellema/)
 * (@jelmerjellema)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-version-2/#post-11827813)
 * Strange… We run php 7.3.7 and did have this problem. Maybe some strange setting
   somewhere?
 *  [Adrian](https://wordpress.org/support/users/adriandw/)
 * (@adriandw)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-version-2/#post-11828265)
 * [@jelmerjellema](https://wordpress.org/support/users/jelmerjellema/)
    It turns
   out the problem was still there – it just wasn’t showing me the error message
   in real-time. But I received an email from WordPress
 * > Your Site is Experiencing a Technical Issue
   >  WordPress caught an error with
   > one of your plugins, MailPoet 2.
 * So I applied your fix to render_engine.php and the problem went away.
    Thank 
   you again
 * Adrian
 *  [jelmerjellema](https://wordpress.org/support/users/jelmerjellema/)
 * (@jelmerjellema)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/fatal-error-version-2/#post-11842300)
 * Good to hear the fix worked out for you!
 *  Thread Starter [Woozy Face](https://wordpress.org/support/users/shaady4/)
 * (@shaady4)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/fatal-error-version-2/#post-11842656)
 * [@adriandw](https://wordpress.org/support/users/adriandw/) don’t you feel bad
   taking over and mastering my post…?
 * The fix for me was upgrading to MailPoet 3.
 * So that’s all for now folks.
 *  [jelmerjellema](https://wordpress.org/support/users/jelmerjellema/)
 * (@jelmerjellema)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/fatal-error-version-2/#post-11842710)
 * Mailpoet 3 is for a lot of people not a good fix on the short term. So the *fix*
   is my fix above, while the *solution* for the long term will be either buying
   MailPoet 3 or finding some other solution.

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

The topic ‘Fatal error version 2’ is closed to new replies.

 * ![](https://ps.w.org/mailpoet/assets/icon-256x256.png?rev=3284564)
 * [MailPoet - Newsletters, Email Marketing, and Automation](https://wordpress.org/plugins/mailpoet/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mailpoet/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mailpoet/)
 * [Active Topics](https://wordpress.org/support/plugin/mailpoet/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mailpoet/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mailpoet/reviews/)

 * 13 replies
 * 5 participants
 * Last reply from: [jelmerjellema](https://wordpress.org/support/users/jelmerjellema/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/fatal-error-version-2/#post-11842710)
 * Status: resolved