PHP 5.3.1 Deprecated functions

yehster wrote on Friday, March 12, 2010:

Is anyone using PHP 5.3.x? The latest version of xampp includes 5.3.1 and there are a number of functions

http://php.net/manual/en/migration53.deprecated.php
At some point these should probably be addressed as some of the deprecated functions are said to be going away in PHP 6

with error reporting on the following show up in the calendar page

<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>C:\xampp\htdocs\openemr\interface\main\calendar\pnadodb\adodb.inc.php</b> on line <b>3211</b><br />
<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>C:\xampp\htdocs\openemr\interface\main\calendar\pnadodb\adodb.inc.php</b> on line <b>3248</b><br />
<br />
<b>Deprecated</b>:  Function session_register() is deprecated in <b>C:\xampp\htdocs\openemr\interface\main\calendar\includes\pnSession.php</b> on line <b>158</b><br />
<br />
<b>Deprecated</b>:  Function session_register() is deprecated in <b>C:\xampp\htdocs\openemr\interface\main\calendar\includes\pnSession.php</b> on line <b>158</b><br />
<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>C:\xampp\htdocs\openemr\interface\main\calendar\modules\PostCalendar\pnuser.php</b> on line <b>149</b><br />
<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>C:\xampp\htdocs\openemr\interface\main\calendar\modules\PostCalendar\pnuser.php</b> on line <b>196</b><br />
<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>C:\xampp\htdocs\openemr\interface\main\calendar\modules\PostCalendar\pnuser.php</b> on line <b>206</b><br />
<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>C:\xampp\htdocs\openemr\interface\main\calendar\modules\PostCalendar\pnuser.php</b> on line <b>276</b><br />
<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>C:\xampp\htdocs\openemr\interface\main\calendar\modules\PostCalendar\pnuser.php</b> on line <b>318</b><br />
<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>C:\xampp\htdocs\openemr\interface\main\calendar\modules\PostCalendar\pnuser.php</b> on line <b>797</b><br />
<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>C:\xampp\htdocs\openemr\interface\main\calendar\modules\PostCalendar\pnuser.php</b> on line <b>849</b><br />
<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>C:\xampp\htdocs\openemr\interface\main\calendar\modules\PostCalendar\pnuser.php</b> on line <b>947</b><br />
<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>C:\xampp\htdocs\openemr\interface\main\calendar\modules\PostCalendar\pnuserapi.php</b> on line <b>159</b><br />
<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>C:\xampp\htdocs\openemr\interface\main\calendar\modules\PostCalendar\pnuserapi.php</b> on line <b>553</b><br />
<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>C:\xampp\htdocs\openemr\interface\main\calendar\modules\PostCalendar\common.api.php</b> on line <b>937</b><br />
<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>C:\xampp\htdocs\openemr\interface\main\calendar\modules\PostCalendar\common.api.php</b> on line <b>940</b><br />
<br />
<b>Deprecated</b>:  Assigning the return value of new by reference is deprecated in <b>C:\xampp\htdocs\openemr\interface\main\calendar\modules\PostCalendar\common.api.php</b> on line <b>1578</b><br />

Just putting this on the radar.

inmymac wrote on Saturday, March 13, 2010:

Remove the ‘&’ before the ‘new’ keyword and it should work fine.

yehster wrote on Saturday, March 20, 2010:

I’m just getting my feet wet, so I submitted a patch to correct the syntax for “new by reference” and “session_register()”

https://sourceforge.net/tracker/?func=detail&aid=2973608&group_id=60081&atid=1245239

bradymiller wrote on Saturday, March 20, 2010:

hi,
I was unable to use this patch. likely related to the path separators being different it seems. What’s the full command or program that you used to create the patch (also what operating system).
-brady

yehster wrote on Saturday, March 20, 2010:

Windows 7 with UnxUtils. 
I did:
diff -rpuN <original interface directory> <new interface directory> > calendar.patch
I am going to submit patches for each individual file and see if that works better.

yehster wrote on Saturday, March 20, 2010:

I submitted new patch files for each of the individual files I changed using command syntax like this:

diff -u common.api.php w:\openemr\interface\main\calendar\modules\PostCalendar\common.api.php > common.api.php.patch

bradymiller wrote on Saturday, March 20, 2010:

hey,
Still not working.
Use these tools instead (much newer, and I recommend ‘Download All’ and placing the bin of all these tools in your path; these work for me on windows 7):
http://gnuwin32.sourceforge.net/
-brady

bradymiller wrote on Saturday, March 20, 2010:

also,
run the command from the w: drive to avoid having that in the path on the diff file (perhaps this may choke up linux).
-brady

tmccormi wrote on Monday, May 31, 2010:

Is there a patch for this or a php.ini configuration that will turn off these notices?
-Tony

tmccormi wrote on Monday, May 31, 2010:

This is the 'Recommendation" but it has no effect on the calendar messages when using LAMPP (xampp on Ubuntu) with 5.1.3 Php

error_reporting =  E_ALL & ~E_NOTICE & ~E_DEPRECATED

bradymiller wrote on Tuesday, June 01, 2010:

hey,

here’s a patch committed to cvs that dealt with some of these:
http://github.com/openemr/openemr/commit/7ca920403a77b97ae6685ff3d916df0c920268dc

-brady

bradymiller wrote on Tuesday, June 01, 2010:

if your trying to take this back to 3.2 (i’m jusst guessing), then in git try following:
1) git checkout rel-320
2) git checkout -b 320_deprec_bug_fix
3) git cherry-pick 7ca920403a77b97ae668

then it will be fixed in your 320_deprec_bug_fix branch.
make patch:
4) git format-patch rel-320

-brady

tmccormi wrote on Tuesday, June 01, 2010:

Cool.  Thanks.