Dmitry Stogov wrote:
> Personally I like the current syntax more and don't see any reason to
> change it.
> 
> Thanks. Dmitry.
> 
> Marcus Boerger wrote:
>> Hello Internals, Dmitry, Lukas, Johannes,
>>
>>   some time back (August 08) I complained about 'use' being at a weird
>> position and not at the same place as 'global' or 'static' where I
>> expected it. Back then Dmitry asked me to provide a patch to check out
>> the alternative. Now during the holidys I finally found some time to
>> change from:
>>        $f = function() use ($x) {}
>> to:
>>        $f = function() { use $x; }
>>
>> Patch is attached.
>>
>> Comments?

I think the current syntax may be clearer:

<?php
namespace blah;
include 'file/with/foo/namespace.php';
use foo/something;
$f = function() use ($x) {}
?>

<?php
namespace blah;
include 'file/with/foo/namespace.php';
use foo/something;
$f = function()
{
use $x;
}
?>

The second version requires a visual re-parsing, the first is clear at a
glance.  In addition, if support for namespaced variables was ever
introduced, confusion would abound.

Thanks,
Greg

P.S. happy new year (I'm a bit slow)

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to