Re: Attributes/Annotations Case Study: Drupal

From: Date: Wed, 04 May 2016 12:38:53 +0000
Subject: Re: Attributes/Annotations Case Study: Drupal
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-93068@lists.php.net to get a copy of this message
Jesse Schalken wrote on 04/05/2016 13:20:
(maybe there should be a $ before the property names, not sure)
And there's the rub! :P When named parameters have been discussed before, there was a lot of bikeshedding over what the syntax should look like, and this is arguably a very similar feature. You could either think of this as "setting lots of variables": new Foo { $bar = 1, $baz = 2 } or you could think of it as "an object literal like an array literal": new Foo { 'bar' => 1, 'baz' => 2 } And then we also need to think about sitting nicely with anonymous class syntax. Not to mention Joe's proposal for lexical scope: https://wiki.php.net/rfc/lexical-anon For the record, I like the idea, if we can come up with a consistent plan for how these pieces of syntax will work together, and not paint ourselves into an ASCII-art hole... Regards, -- Rowan Collins [IMSoP]

« previous php.internals (#93068) next »