>> $foo = {
>> 'bar' : function(){
>> echo 'baz';
>> }
>> };
>>
>> $foo->bar();
>
> I guess it's not yet too late to surpass Perl in the front of obscurity...
Since the stuff to the right of the assignment operator (`:` in this case) is
valid PHP, I don't see why this wouldn't be allowed if we adopt the {} syntax.
It's not much different from this, which is currently valid:
$foo = (object)array(
'bar' => function () {
echo 'baz';
}
};
S
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php