Code: Select all
// example 1
function foo_func(&$foo)
{
$foo = "baz";
}
$bar = foo_func(&$biz);
// example 2
function foo_func(&$foo)
{
$foo = "baz";
}
$bar = foo_func($biz);PHP.net examples use syntax like number 2. A lot of tutorials I'm reading and classes I've downloaded use syntax like number 1.
Is the syntax for number 1 being deprecated, or is this just a "You do it one way, I perfer to do it another way" type of thing.
I read on PHP.net that not including the ampersand in the function definition is being deprecated, but that doesn't address either of the two examples above.
Thanks