Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-03-03 Thread Nikita Popov
On Tue, Feb 26, 2013 at 6:08 PM, Dmitry Stogov wrote: > On Tue, Feb 26, 2013 at 8:49 PM, Nikita Popov wrote: > >> On Tue, Feb 26, 2013 at 7:41 AM, Dmitry Stogov wrote: >> >>> Hi Nikita, >>> >>> I like the idea. >>> But note, that it may cause some unexpected behaviour and bugs. >>> I didn't test

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-03-03 Thread Stas Malyshev
Hi > > - usage expression in write context (e.g. passing constant by reference) > > function foo(&$foo) {} > foo("abc"[0]); > > - destruction of temporary result > > ($a . $b)[4]; // if ($a.$b) is destroyed? > > - in some cases destruction of temporary result may cause destruction of > final

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-26 Thread Pierre Joye
hi, On Tue, Feb 26, 2013 at 7:21 PM, Dmitry Stogov wrote: > The idea from the user perspective is very simple and clear. > I really don't see what to discuss. All the questions are about > implementation and they must be solvable. The idea is all the edge cases and possible issues listed so it c

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-26 Thread Dmitry Stogov
The idea from the user perspective is very simple and clear. I really don't see what to discuss. All the questions are about implementation and they must be solvable. Thanks. Dmitry. On Tue, Feb 26, 2013 at 10:04 PM, Pierre Joye wrote: > On Mon, Feb 25, 2013 at 5:14 PM, Nikita Popov > wrote: >

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-26 Thread Pierre Joye
On Mon, Feb 25, 2013 at 5:14 PM, Nikita Popov wrote: > Thoughts? There is now more than enough materials to put in a well written RFC. Thanks :-) -- Pierre @pierrejoye -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-26 Thread Felipe Pena
Hi, > > Yeah. It's not a simple patch. In the past, we had a lot of problems after > introducing foo()[$i] syntax, because some edge cases were not taken in > account. > > Thanks. Dmitry. >From what I remember, the same problem that I spotted by foo()[$i] is the one that we already had with foo()

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-26 Thread Dmitry Stogov
On Tue, Feb 26, 2013 at 8:49 PM, Nikita Popov wrote: > On Tue, Feb 26, 2013 at 7:41 AM, Dmitry Stogov wrote: > >> Hi Nikita, >> >> I like the idea. >> But note, that it may cause some unexpected behaviour and bugs. >> I didn't test the patch I just guess it on my previous experience >> introduci

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-26 Thread Nikita Popov
On Tue, Feb 26, 2013 at 7:41 AM, Dmitry Stogov wrote: > Hi Nikita, > > I like the idea. > But note, that it may cause some unexpected behaviour and bugs. > I didn't test the patch I just guess it on my previous experience > introducing similar features. > > - usage expression in write context (e.

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-26 Thread Dmitry Stogov
On Tue, Feb 26, 2013 at 7:10 PM, Nikita Popov wrote: > On Tue, Feb 26, 2013 at 7:41 AM, Dmitry Stogov wrote: > >> Hi Nikita, >> >> I like the idea. >> But note, that it may cause some unexpected behaviour and bugs. >> I didn't test the patch I just guess it on my previous experience >> introduci

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-26 Thread Nikita Popov
On Tue, Feb 26, 2013 at 7:41 AM, Dmitry Stogov wrote: > Hi Nikita, > > I like the idea. > But note, that it may cause some unexpected behaviour and bugs. > I didn't test the patch I just guess it on my previous experience > introducing similar features. > > - usage expression in write context (e.

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-26 Thread Alain Williams
On Tue, Feb 26, 2013 at 01:35:47PM +0100, Sebastian Krebs wrote: > 2013/2/26 Lazare Inepologlou > > > Hello Nikita, > > > > 2013/2/25 Nikita Popov > > > > > Hi internals! > > > > > > PHP 5.4 added support for expressions of the kind (new Foo)->bar(), (new > > > Foo)->bar and (new Foo)['bar']. >

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-26 Thread Sebastian Krebs
2013/2/26 Lazare Inepologlou > Hello Nikita, > > 2013/2/25 Nikita Popov > > > Hi internals! > > > > PHP 5.4 added support for expressions of the kind (new Foo)->bar(), (new > > Foo)->bar and (new Foo)['bar']. > > > > > I guess it must have been discussed, but Is there any technical reason or > c

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-26 Thread Lazare Inepologlou
Hello Nikita, 2013/2/25 Nikita Popov > Hi internals! > > PHP 5.4 added support for expressions of the kind (new Foo)->bar(), (new > Foo)->bar and (new Foo)['bar']. > > I guess it must have been discussed, but Is there any technical reason or conflict that prevents us from having something like n

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-25 Thread Stas Malyshev
Hi! > - in some cases destruction of temporary result may cause destruction of > final result > > ((object)(array("a"=>"b")))->a = "c"; // temporary object may be destroyed > before assignment I remember now this was somewhat of a problem - when the temp is destroyed? I.e. I guess we could stick

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-25 Thread Dmitry Stogov
Hi Nikita, I like the idea. But note, that it may cause some unexpected behaviour and bugs. I didn't test the patch I just guess it on my previous experience introducing similar features. - usage expression in write context (e.g. passing constant by reference) function foo(&$foo) {} foo("abc"[0]

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-25 Thread Christopher Jones
On 02/25/2013 04:33 PM, Sara Golemon wrote: When it comes to changing syntax, there is no such thing as too small of an RFC IMO. Runtime changes can occasionally be hand-waved, but syntax changes are serious business. Seeing this quoted makes me realize I expressed myself poorly. What I me

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-25 Thread Sara Golemon
>>> When it comes to changing syntax, there is no such thing as too small >>> of an RFC IMO. Runtime changes can occasionally be hand-waved, but >>> syntax changes are serious business. > Seeing this quoted makes me realize I expressed myself poorly. What I meant to convey was: When it comes to

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-25 Thread Bob Weinand
Am 26.02.2013 um 00:08 schrieb "Stas Malyshev" : > Hi! > >> Don't consider it as a syntax change, only as a bugfix. It must have been a >> bug, that this degree of conformity was not yet reached. :-P > > If it changes syntax, it's by definition a syntax change. It does not > matter if you think

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-25 Thread Jelle Zijlstra
2013/2/25 Nikita Popov > Hi internals! > > PHP 5.4 added support for expressions of the kind (new Foo)->bar(), (new > Foo)->bar and (new Foo)['bar']. > > I'd like to extend this support to any expression instead of just new. > > Why should be do this? Because it's just an arbitrary restriction. R

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-25 Thread Stas Malyshev
Hi! > Don't consider it as a syntax change, only as a bugfix. It must have been a > bug, that this degree of conformity was not yet reached. :-P If it changes syntax, it's by definition a syntax change. It does not matter if you think it should be changed and if you think it's a bug, it still sho

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-25 Thread Johannes Schlüter
On Mon, 2013-02-25 at 23:20 +0100, Bob Weinand wrote: > Don't consider it as a syntax change, only as a bugfix. It must have been a > bug, that this degree of conformity was not yet reached. :-P > > It's only stupid to vote about such microscopic changes as long as there are > no real arguments ag

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-25 Thread Lars Strojny
Hi Nikita, Am 25.02.2013 um 23:20 schrieb Bob Weinand : [...] >> When it comes to changing syntax, there is no such thing as too small >> of an RFC IMO. Runtime changes can occasionally be hand-waved, but >> syntax changes are serious business. I very much like it, it’s a good change. But can we

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-25 Thread Bob Weinand
Am 25.2.2013 um 23:07 schrieb Sara Golemon : >> (For me, it's changes like Sara's trailing comma proposal that are too >> small to have needed an RFC) >> > When it comes to changing syntax, there is no such thing as too small > of an RFC IMO. Runtime changes can occasionally be hand-waved, but >

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-25 Thread Sara Golemon
> (For me, it's changes like Sara's trailing comma proposal that are too > small to have needed an RFC) > When it comes to changing syntax, there is no such thing as too small of an RFC IMO. Runtime changes can occasionally be hand-waved, but syntax changes are serious business. -Sara -- PHP In

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-25 Thread Ralph Schindler
PHP 5.4 added support for expressions of the kind (new Foo)->bar(), (new Foo)->bar and (new Foo)['bar']. I'd like to extend this support to any expression instead of just new. I like it, we discussed this 2 years ago, could you address my original use case? Would it work: $value = ($obj

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-25 Thread Pierre Joye
hi, On Mon, Feb 25, 2013 at 7:12 PM, Christopher Jones wrote: > I think a brief RFC would be good to clarify and give some more examples of > what "any expression" is. Seeing more examples would help people > evaluate the impact and see the use cases. It would also help the doc > process. > > (

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-25 Thread Christopher Jones
On 02/25/2013 08:14 AM, Nikita Popov wrote: Hi internals! PHP 5.4 added support for expressions of the kind (new Foo)->bar(), (new Foo)->bar and (new Foo)['bar']. I'd like to extend this support to any expression instead of just new. Why should be do this? Because it's just an arbitrary rest

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-25 Thread Daniel Macedo
Yeah, like this as well, and +1 for consistency.

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-25 Thread Sara Golemon
> PHP 5.4 added support for expressions of the kind (new Foo)->bar(), (new > Foo)->bar and (new Foo)['bar']. > > I'd like to extend this support to any expression instead of just new. > A winner is you. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-25 Thread Pierre Joye
On Feb 25, 2013 5:14 PM, "Nikita Popov" wrote: > > Thoughts? I like the idea. I can't see nor imagine any BC breaks that could be introduce by this change. Cheers,

Re: [PHP-DEV] Allow (...)->foo() expressions not only for `new`

2013-02-25 Thread Jonathan Wage
It makes sense to me. +1 for making the syntax more consistent and natural. - Jon On Mon, Feb 25, 2013 at 10:14 AM, Nikita Popov wrote: > Hi internals! > > PHP 5.4 added support for expressions of the kind (new Foo)->bar(), (new > Foo)->bar and (new Foo)['bar']. > > I'd like to extend this sup