Re: Inconsistencies in 5.3

From: Date: Wed, 06 Aug 2008 02:13:22 +0000
Subject: Re: Inconsistencies in 5.3
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-39682@lists.php.net to get a copy of this message
Larry Garfield wrote:
On Tuesday 05 August 2008 12:48:37 am Moriyoshi Koizumi wrote:
I don't think there are many differences in ambiguity between $closure = function ($arg) { use $a; ... }; and $closure = function ($arg) use ($a) { }; Moriyoshi -- Moriyoshi Koizumi <moriyoshi@at.wakwak.com>
The former has no good way to differentiate between by-ref and by-value importing. The latter has a very intuitive way. That's why (IIRC) it was used.
The only difference I could see between the two is the presence of parenthesis. I doubt they contribute to the intuitiveness that much. function ($arg) { use $a, &$b; v.s. function ($arg) use ($a, &$b) { Moriyoshi

« previous php.internals (#39682) next »