http://www.php.net/manual/en/languag...ces.return.php
Citat:
Note: Unlike parameter passing, here you have to use & in both places - to indicate that you return by-reference, not a copy as usual, and to indicate that reference binding, rather than usual assignment, should be done for $foo.
|
Ukratko moras da imas & i u definiciji f-je kao u primeru na linku gore.
Isto tako:
Citat:
Note: If you try to return a reference from a function with the syntax: return ($found_var); this will not work as you are attempting to return the result of an expression, and not a variable, by reference. You can only return variables by reference from a function - nothing else. E_NOTICE error is issued since PHP 4.4.0 and PHP 5.1.0 if the code tries to return a dynamic expression or a result of the new operator.
|
Dakle, moguce je da ti ovo pravi problem. Ako imas iskaz tipa: return ($found_var); u f-ji onda ti vracas expression a ne variablu. Skloni zagrade i bice ok.