ballhogjoni Posted October 8, 2010 Share Posted October 8, 2010 I am running php 5.3.2 on my local dev and on the server I am running php 5.2.5. In my log files I keep getting deprecated messages like: PHP Deprecated: Assigning the return value of new by reference is deprecated in /Users/xxx/dev/git/xxx/cake/dispatcher.php on line 677 Can I just delete & to get rid of this message or will that hose the script locally and on the server? I believe that php 5+ passes all objects as reference. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/215433-can-i-delete-the-symbol/ Share on other sites More sharing options...
BlueSkyIS Posted October 8, 2010 Share Posted October 8, 2010 lacking any other answers, my educated guess is that you can just remove the ampersand. Quote Link to comment https://forums.phpfreaks.com/topic/215433-can-i-delete-the-symbol/#findComment-1120248 Share on other sites More sharing options...
Adam Posted October 8, 2010 Share Posted October 8, 2010 Prior to PHP5, passing by reference meant the referenced variable would contain the actual object. Now however only a reference kind of ID to the object is stored within the variable. Returning that by reference would mean a reference to a reference, which basically dereferences to the same thing (..and is why PHP has made it deprecated). So yes, you can remove the ampersands without any worry. Quote Link to comment https://forums.phpfreaks.com/topic/215433-can-i-delete-the-symbol/#findComment-1120254 Share on other sites More sharing options...
ballhogjoni Posted October 8, 2010 Author Share Posted October 8, 2010 Prior to PHP5, passing by reference meant the referenced variable would contain the actual object. Now however only a reference kind of ID to the object is stored within the variable. Returning that by reference would mean a reference to a reference, which basically dereferences to the same thing (..and is why PHP has made it deprecated). So yes, you can remove the ampersands without any worry. Thanks, thats what I thougt, this solves it! Quote Link to comment https://forums.phpfreaks.com/topic/215433-can-i-delete-the-symbol/#findComment-1120256 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.