Date: 11/27/00
- Next message: Colin Viebrock: "RE: [PHP-DEV] New Site"
- Previous message: waldschrott <email protected>: "[PHP-DEV] PHP 4.0 Bug #7530 Updated: Session does not store Objects"
- Next in thread: Derick Rethans: "Re: [PHP-DEV] Passing by reference"
- Reply: Derick Rethans: "Re: [PHP-DEV] Passing by reference"
- Reply: André Langhorst: "Re: [PHP-DEV] Passing by reference"
- Maybe reply: Andi Gutmans: "Re: [PHP-DEV] Passing by reference"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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>
- Next message: Colin Viebrock: "RE: [PHP-DEV] New Site"
- Previous message: waldschrott <email protected>: "[PHP-DEV] PHP 4.0 Bug #7530 Updated: Session does not store Objects"
- Next in thread: Derick Rethans: "Re: [PHP-DEV] Passing by reference"
- Reply: Derick Rethans: "Re: [PHP-DEV] Passing by reference"
- Reply: André Langhorst: "Re: [PHP-DEV] Passing by reference"
- Maybe reply: Andi Gutmans: "Re: [PHP-DEV] Passing by reference"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

