Re: [PHP-DEV] Passing by reference From: Andi Gutmans (andi <email protected>)
Date: 11/27/00

Sure, you can subscribe at zend-cvs-subscribe <email protected>

Andi

At 19:58 27/11/00 +0100, Derick Rethans wrote:
>Hi Andi,
>
>is there a way so we can see the zend cvs commit messages?
>
>Derick
>
>Andi Gutmans wrote:
> >
> > Hi,
> >
> > I just commited a patch which lightens up the restrictions Zeev and I
> > introduced a few weeks ago in the CVS tree of passing certain arguments to
> > functions which declare the argument to be passed by reference.
> > It's a big patch so please try and see if it works.
> > If you have a function:
> > function foo(&$a)
> > {
> > }
> > The following can be passed to foo():
> > a) A variable, i.e. foo($a)
> > b) A new statement, i.e. foo(new foobar());
> > c) A reference returned from a function, i.e.:
> > function &bar()
> > {
> > $a = 5;
> > return $a;
> > }
> > foo(bar());
> >
> > All other expressions are undefined and can not be passed by reference.
> > For example:
> > a)
> > function bar() // Note the missing &
> > {
> > $a = 5;
> > return $a;
> > }
> > foo(bar));
> >
> > b) foo($a = 5);
> > c) foo(5);
> >
> > Please let me know if this solves some of the bugs people have been
> > reporting with the current CVS tree.
> >
> > Andi
> > ---
> > Andi Gutmans <andi <email protected>>
> > http://www.zend.com/
> >
> > --
> > 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>
>
>--
>Derick Rethans
>
>---------------------------------------------------------------------
> PHP: Scripting the Web - www.php.net - derick <email protected>
>---------------------------------------------------------------------
> JDI Media Solutions - www.jdimedia.nl - d.rethans <email protected>
> H.v. Tussenbroekstraat 1 - 6952 BL Dieren - The Netherlands
>---------------------------------------------------------------------

---
Andi Gutmans <andi <email protected>>
http://www.zend.com/

-- 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>