Hi Ralph! This (in it's current form) doesn't look like a good idea to me. You are only handling yet another edge case. ($foo = $bar = new A)->bar() would again not work.
If we really want this kind of (expr)-> syntax, then it should really accept *any* expr. But I am not quite sure whether this will work out easily because in this case we can't be sue that expr is an object (but maybe it'll be simple, I just don't know). Nikita On Wed, Nov 30, 2011 at 7:09 PM, Ralph Schindler <ra...@ralphschindler.com> wrote: > Hey all (Filipe), > > This was brought up in the thread "New dereferencing syntaxes in 5.4". > > I too think this would be beneficial: > > $value = ($obj = new Foo)->produceAValue(); > > but the current parser (branch 5.4) doesn't have a rule for this. I've > attached a quick/working patch, but I don't fully understand the > ramifications of such a patch. > > Can someone explain the drawbacks of increasing the "%expect n" for me? > > Would this many s/r require/benefit from a new expression grouping? > > More to the point, can we have this small change for 5.4? > > Thanks in advance. > -ralph > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php