Re: [PHP4BETA] return references branch merged into the main repository

From: Date: Thu, 16 Dec 1999 14:54:53 +0000
Subject: Re: [PHP4BETA] return references branch merged into the main repository
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-8000@lists.php.net to get a copy of this message
& is an operator that works on variables and function calls. It does not work on expressions. Zeev On Thu, 16 Dec 1999, Stanislav Malyshev wrote: > ZS>> To assign a reference, you must use the special assign-reference > ZS>> notation. When assigning a variable, the notation does the job of > > > But this notation seems not consistent now. > > Neither: > > $a = new foo_bar(); > $x = new foo_bar(); > $b = &($choose_a_b ? ret_ref($a) : ret_ref($b)); > > or > > $a = new foo_bar(); > $x = new foo_bar(); > $b = $choose_a_b ? &ret_ref($a) : &ret_ref($b); > > do not work. Even > > $b = &(foo()); > > doesn't work. > > So what is this & and what it's linked to? If it's "=&" operator, > why > first is illegal? If it operates on function call, why second is illegal? > >

« previous php.version4 (#8000) next »