n1concepts Posted August 20, 2012 Share Posted August 20, 2012 Hi, Just curious is anyone have suggestions on a permanent fix regarding PEAR error that has popped up for several pages after upgrading PHP from version 4 to 5. Note: I know the issue is with the 'referenced' not be accepted in the newer version but wanted see if someone had also experienced this issue and if the fix was simply 'removing the ampersand sign (&) from all values in code to resolve the issue. Here's example of error: Deprecated: Assigning the return value of new by reference is deprecated in /home/content/p/h/e/dkdke/html/fske/install/PEAR/PEAR.php on line 569 Deprecated: Assigning the return value of new by reference is deprecated in /home/content/p/h/e/dkdke/html/fske/install/PEAR/PEAR.php on line 572 Quote Link to comment https://forums.phpfreaks.com/topic/267340-deprecated-pear-errors-after-php-module-upgrade-from-4x-to-v5/ Share on other sites More sharing options...
MMDE Posted August 20, 2012 Share Posted August 20, 2012 You will need to post some code, and an easy google search should give you an idea of what is wrong! Quote Link to comment https://forums.phpfreaks.com/topic/267340-deprecated-pear-errors-after-php-module-upgrade-from-4x-to-v5/#findComment-1370836 Share on other sites More sharing options...
n1concepts Posted August 20, 2012 Author Share Posted August 20, 2012 I'll post the code since you asked but the error already tells me the issue - I just wanted to hear from others that dealing w/similar issue. Note: I already know that removing the reference will fix the issue but was curious to hear if doing so creating other issues being the problem is due to PEAR not keeping up with PHP updates. Yes, I know Google provides answers - found my answer from that search - but (again) this is simply to get 'real coders' feedback. But I do appreciate your response and suggestions. Here's the code you asked to see - comments welcomed (truly) if ($skipmsg) { $a =& new $ec($code, $mode, $options, $userinfo); return $a; } else { $a =& new $ec($message, $code, $mode, $options, $userinfo); return $a; } Quote Link to comment https://forums.phpfreaks.com/topic/267340-deprecated-pear-errors-after-php-module-upgrade-from-4x-to-v5/#findComment-1370843 Share on other sites More sharing options...
darkfreaks Posted August 20, 2012 Share Posted August 20, 2012 remove the ampersand should just be if ($skipmsg) { $a = new $ec($code, $mode, $options, $userinfo); return $a; } else { $a = new $ec($message, $code, $mode, $options, $userinfo); return $a; } otherwise you will get deprecated errors. Quote Link to comment https://forums.phpfreaks.com/topic/267340-deprecated-pear-errors-after-php-module-upgrade-from-4x-to-v5/#findComment-1370963 Share on other sites More sharing options...
n1concepts Posted August 20, 2012 Author Share Posted August 20, 2012 Yeah, I did and suddenly I get 'blank' pages not - no errors what so ever and I have error_reporting set to display all. Note: that leads me to think there have been other (custom) edits to this code so I'm discussing w/site owner now. Yes, I confirm your comments - that did fix that problem but now another host of issues... Thanks for response! Quote Link to comment https://forums.phpfreaks.com/topic/267340-deprecated-pear-errors-after-php-module-upgrade-from-4x-to-v5/#findComment-1370966 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.