PHP Deprecated Warning - How to fix PHP code

octort wrote on Wednesday, September 26, 2012:

OEMR Ver: 4.0.0
PHP Ver: 5.3.16

I am getting the following lines in the error_log file:

PHP Deprecated:  Assigning the return value of new by reference is deprecated in /home/clinic/public_html/openemr/library/adodb/adodb.inc.php on line 861
PHP Deprecated:  Assigning the return value of new by reference is deprecated in /home/clinic/public_html/openemr/library/adodb/adodb.inc.php on line 867
PHP Deprecated:  Assigning the return value of new by reference is deprecated in /home/clinic/public_html/openemr/library/adodb/adodb.inc.php on line 1175
PHP Deprecated:  Assigning the return value of new by reference is deprecated in /home/clinic/public_html/openemr/library/adodb/adodb.inc.php on line 1940
PHP Deprecated:  Assigning the return value of new by reference is deprecated in /home/clinic/public_html/openemr/library/adodb/adodb.inc.php on line 2960
PHP Deprecated:  Assigning the return value of new by reference is deprecated in /home/clinic/public_html/openemr/library/adodb/adodb.inc.php on line 3486
PHP Deprecated:  Assigning the return value of new by reference is deprecated in /home/clinic/public_html/openemr/library/adodb/adodb.inc.php on line 3526
PHP Deprecated:  Assigning the return value of new by reference is deprecated in /home/clinic/public_html/openemr/library/adodb/adodb.inc.php on line 3545
PHP Deprecated:  Function split() is deprecated in /home/clinic/public_html/openemr/library/classes/Controller.class.php on line 85
PHP Deprecated:  Function split() is deprecated in /home/clinic/public_html/openemr/library/classes/Controller.class.php on line 153
PHP Deprecated:  Function split() is deprecated in /home/clinic/public_html/openemr/library/classes/Controller.class.php on line 153
PHP Deprecated:  Function split() is deprecated in /home/clinic/public_html/openemr/library/classes/Controller.class.php on line 153
PHP Deprecated:  Function split() is deprecated in /home/clinic/public_html/openemr/library/classes/Controller.class.php on line 153
PHP Deprecated:  Function split() is deprecated in /home/clinic/public_html/openemr/library/classes/Controller.class.php on line 153
PHP Deprecated:  Function split() is deprecated in /home/clinic/public_html/openemr/library/classes/Controller.class.php on line 153
PHP Deprecated:  Function split() is deprecated in /home/clinic/public_html/openemr/library/classes/Controller.class.php on line 153
PHP Deprecated:  Function split() is deprecated in /home/clinic/public_html/openemr/library/classes/Controller.class.php on line 153
PHP Deprecated:  Function split() is deprecated in /home/clinic/public_html/openemr/library/classes/Controller.class.php on line 153
PHP Deprecated:  Function split() is deprecated in /home/clinic/public_html/openemr/library/classes/Controller.class.php on line 153

HOW CAN I FIX THE PHP CODE TO BE COMPATIBLE WITH THE CURRENT CONFIGURATION?
THANKS IN ADVANCE!

tmccormi wrote on Wednesday, September 26, 2012:

You can fix the code by replacing the deprecated functions with functions that are no longer deprecated.  The community would love that contribution.

If all you want to do is turn off the warnings, edit your php.ini setting as shown in:  http://www.open-emr.org/wiki/index.php/FAQ#What_are_the_correct_PHP_settings_.28can_be_found_in_the_php.ini_file.29_.3F
-Tony

octort wrote on Wednesday, September 26, 2012:

I just removed the “&” before “new” on each line and now the messages are gone.

as suggested at https://sourceforge.net/projects/openemr/forums/forum/202506/topic/3597505

not sure if this change will not affect negatively something later.

bradymiller wrote on Thursday, September 27, 2012:

Hi,
I’d consider upgrading to OpenEMR 4.1.1 (this version fixed lots of the deprecated code stuff), especially since you php version is rather recent.
-brady
OpenEMR