cornelombaard Posted February 4, 2011 Share Posted February 4, 2011 So does it mean that you cannot call variables by reference in newer version of php? Why is it deprecated? Is it abad thing or what? Any help is appreciated. Quote Link to comment Share on other sites More sharing options...
ChemicalBliss Posted February 4, 2011 Share Posted February 4, 2011 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. Quote Link to comment 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.