Re: Passing-by-reference

From: Date: Thu, 23 Nov 2000 21:16:51 +0000
Subject: Re: Passing-by-reference
References: 1 2  Groups: php.dev php.qa 
Request: Send a blank email to php-dev+get-39035@lists.php.net to get a copy of this message
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é

« previous php.dev (#39035) next »