Re: [PHP-DEV] Passing-by-reference From: André Langhorst (A.Langhorst <email protected>)
Date: 11/23/00

> Receiving arguments by reference:
> ----------------------------------------
> Three ways of passing an argument to a function which wants to receive
> its argument by reference:
> a) foo($a) // Passing a variable
> b) foo(new foo()) // Passing a newly created object
> c) foo(MyFactory()) // Where MyFactory() is explicitly defined to return
> the return value by reference, which is done by defining it as "function
> &MyFactor(){...}"
>
> ALL OTHER ARGUMENT PASSING RESULTS IN UNDEFINED BEHAVIOR!

*anyone* should be able to understand this and avoid that "undefined
behaviour"!

but it would be interesting what *could* happen... if just copied, fine

andré

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>