Hi all, On Wed, Feb 25, 2015 at 4:06 AM, S.A.N <ua.san.a...@gmail.com> wrote:
> Yes, is problem - properties and methods look the same, how to solve > this problem in PHP I do not know. > Perhaps PHP could interpret this code: > $object = > { > 'property' => $value, > 'method' => function (){...} > }; > > AS > > $object = new class > { > public $property = $value; > public function method (){...} > } > > Use case - inline object without inheritance and traits, only the > properties and methods it brief and easily understood JSON syntax, I > think it would be popular with developers of PHP. > It's not directly related to the topic, but I would like to have "code block" that returns "value" with this syntax rather than defining anonymous class/object. BTW, I'm +1 for the idea having anonymous class. Regards, -- Yasuo Ohgaki yohg...@ohgaki.net