Jump to content

Call-time pass-by-reference has been deprecated - What does this mean?


cornelombaard

Recommended Posts

It's deprecated because PHP does this automatically now.

 

Call-Time Pass by reference.

Your passing a reference to a function.

In the new PHP they realised instead of letting people specifically pass a reference to a function, the function should specify whether its arguments should be passed-by-reference. (Cuts down argument discrepencies and makes code a little easier to read).

 

So, remove any & when calling a fnuction.

and on the function itself add an & in front of the arguments you want to be referenced. eg:

 

function somefunc($arg1, &$ref1, $arg2)

 

$ref1 will be a reference.

 

hope this helps.

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.