Jump to content

Can I delete the & symbol


ballhogjoni

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/215433-can-i-delete-the-symbol/
Share on other sites

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.

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!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.