Re: [PHP4BETA] return references branch merged into the main repository
| From: | zeev at zend dot com | Date: | Thu, 16 Dec 1999 15:13:21 +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-8001@lists.php.net to get a copy of this message | ||
To be clearer, it works on variables and function calls only, and is only
used to denote an assignment of a reference, as opposed to assignment by
value. You can't use it on expressions or in expressions.
Zeev
On Thu, 16 Dec 1999 zeev@zend.com wrote:
> & 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?
> >
> >
>
>
>