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
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.

Link to comment
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.

 

Thanks, thats what I thougt, this solves it!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.