jdorn / php-reports

A PHP framework for displaying reports from any data source, including SQL and MongoDB
http://jdorn.github.com/php-reports
GNU Lesser General Public License v3.0
477 stars 234 forks source link

PHP 7 Warning: preg_replace(): The /e modifier is no longer supported #223

Open jayhar opened 8 years ago

jayhar commented 8 years ago

Any chance there will php 7.0 support as I am receiving the following error in many locations: _Warning: preg_replace(): The /e modifier is no longer supported, use preg_replacecallback instead in C:\xampp\htdocs\php-reports\lib\PhpReports\PhpReports.php on line 645

$json = preg_replace('/\'(([^\']|\\\\\')*)\'\s*:/e', "json_encode(stripslashes('$1')).':'", $json);

ManZzup commented 8 years ago

check my last comment for a fix

https://github.com/jdorn/php-reports/issues/227

henrisouzarj commented 7 years ago

Hi, my php is 5.6 and having same error (phpinfo() below). I just changed the "if(PHP_MAJOR_VERSION >= 7){" and " }else if(PHP_MAJOR_VERSION < 7){" to consider 5.6 and not 7.

Solved my problem.

Thanks ManZzup. Just trying to contribute a little more.

Best wishes.

PHP logo PHP Version 5.6.27

System Linux hm8227 3.14.58-grsec-1.lw5.x86_64 #1 SMP Wed Dec 16 11:25:15 UTC 2015 x86_64 Build Date Oct 17 2016 14:21:34 Server API CGI/FastCGI Virtual Directory Support disabled Configuration File (php.ini) Path /etc/php56.d Loaded Configuration File /home/desenvsa/php.ini Scan this dir for additional .ini files /etc/php56.d