Re: [PHP-DEV] [RFC] Fix "foreach" behavior

2015-02-01 Thread Lester Caine
On 01/02/15 03:39, Dmitry Stogov wrote: > I also thought about similar approach for "object by value case". > I think, first we should accept the proposed in thic RFC behavior. It's > consistent, and more comatible with PHP5. Later, if we decide to merge > zend_array with HashTable we may try to ch

Re: [PHP-DEV] [RFC] Fix "foreach" behavior

2015-01-31 Thread Dmitry Stogov
I also thought about similar approach for "object by value case". I think, first we should accept the proposed in thic RFC behavior. It's consistent, and more comatible with PHP5. Later, if we decide to merge zend_array with HashTable we may try to change it. Thanks. Dmitry. On Jan 31, 2015 4:18 P

Re: [PHP-DEV] [RFC] Fix "foreach" behavior

2015-01-31 Thread Dmitry Stogov
Thanks for benchmarks. This time I didn't see so good results myself :) I actually, started this work with performance in mind, but after understanding all existing incosistencies, think that consistency is more important. Thanks. Dmitry. On Jan 31, 2015 11:18 AM, "Rasmus Lerdorf" wrote: > On 01

Re: [PHP-DEV] [RFC] Fix "foreach" behavior

2015-01-31 Thread Nikita Popov
On Fri, Jan 30, 2015 at 8:23 AM, Dmitry Stogov wrote: > Hi, > > I'd like to start discussion about fixing inconsistent "foreach" statement > behavior. > The implementation is almost done. It not only fixes inconsistencies in a > defined by RFC way but also improves performance in most usual cases

Re: [PHP-DEV] [RFC] Fix "foreach" behavior

2015-01-31 Thread Xinchen Hui
On Sat, Jan 31, 2015 at 4:18 PM, Rasmus Lerdorf wrote: > On 01/30/2015 09:10 PM, Dmitry Stogov wrote: >> Hi, >> >> Nikita got an idea about stopping changing of array/object internal >> pointers even in forech by reference. >> I've added an additional RFC section: >> >> https://wiki.php.net/rfc/ph

Re: [PHP-DEV] [RFC] Fix "foreach" behavior

2015-01-31 Thread Rasmus Lerdorf
On 01/30/2015 09:10 PM, Dmitry Stogov wrote: > Hi, > > Nikita got an idea about stopping changing of array/object internal > pointers even in forech by reference. > I've added an additional RFC section: > > https://wiki.php.net/rfc/php7_foreach#additional_behavoir_change > > Trivial implementati

Re: [PHP-DEV] [RFC] Fix "foreach" behavior

2015-01-30 Thread Dmitry Stogov
Hi, Nikita got an idea about stopping changing of array/object internal pointers even in forech by reference. I've added an additional RFC section: https://wiki.php.net/rfc/php7_foreach#additional_behavoir_change Trivial implementation on top of the main patch: https://gist.github.com/dstogov/6

Re: [PHP-DEV] [RFC] Fix "foreach" behavior

2015-01-30 Thread Dmitry Stogov
That sentence was about "foreach by value". "foreach by reference" in your example will still work as expected :) Thanks. Dmitry. On Fri, Jan 30, 2015 at 2:07 PM, Alain Williams wrote: > On Fri, Jan 30, 2015 at 11:23:19AM +0400, Dmitry Stogov wrote: > > Hi, > > > > I'd like to start discussion

Re: [PHP-DEV] [RFC] Fix "foreach" behavior

2015-01-30 Thread Alain Williams
On Fri, Jan 30, 2015 at 11:23:19AM +0400, Dmitry Stogov wrote: > Hi, > > I'd like to start discussion about fixing inconsistent "foreach" statement > behavior. > The implementation is almost done. It not only fixes inconsistencies in a > defined by RFC way but also improves performance in most usu

Re: [PHP-DEV] [RFC] Fix "foreach" behavior

2015-01-30 Thread Julien Pauli
On Fri, Jan 30, 2015 at 8:23 AM, Dmitry Stogov wrote: > Hi, > > I'd like to start discussion about fixing inconsistent "foreach" statement > behavior. > The implementation is almost done. It not only fixes inconsistencies in a > defined by RFC way but also improves performance in most usual cases

Re: [PHP-DEV] [RFC] Fix "foreach" behavior

2015-01-30 Thread Benjamin Coutu
Hi Dmitry, Thank you for picking up on our proposal. RFC and patch look promising - awesome work! I am looking forward to it. Ben == Original == From: Dmitry Stogov To: PHP Internals Date: Fri, 30 Jan 2015 08:23:19 +0100 Subject: [PHP-DEV] [RFC] Fix "foreach" behavior Hi, I'