Re: Problem with pass-by-ref

From: Date: Sun, 19 Nov 2000 21:09:03 +0000
Subject: Re: Problem with pass-by-ref
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-38517@lists.php.net to get a copy of this message
Hi Andi, there are 2 major problems regarding your patch... 1)
bar(foo()); // This will work now. bar(new foobar()); // Should work. bar(5); // Won't work bar($a = 5) // Won't work.
the third+fourth both DO work!
Please check if your code which broke due to our previous patch with a "Only variables can be passed by reference" is OK now (unless your code was really broken :)
2) broken again (not mine), the patch... it only happens inside classes AFAIK <?php function foo() { $i=1; return $i; } $foo = new foobar(); class foobar { function foobar() { $this->bar($this); // works $this->bar(foo()); // not } function bar(&$blah) {
    print "Hey, what's wrong?"; }	
} ?> andré -- · André Langhorst · t: +49 571 3201801 · · waldschrott@php.net · m: +49 173 9558736 · · PHP Quality Assurance · http://qa.php.net ·

« previous php.dev (#38517) next »