[RFC]Call for voting about const array/string dereference

php.internals

Laruence

14 years ago
Hi: Call for voting about the const array/string derefernce RFC now. you can find more info here: https://wiki.php.net/rfc/constdereference#vote thanks
-- Laruence  Xinchen Hui http://www.laruence.com/

Nikita Popov

14 years ago
This can't go into PHP 5.4.0 in any case, because it is a feature addition and the release is already in RC. Nikita On Tue, Dec 13, 2011 at 7:16 AM, Laruence <laruence@php.net> wrote:

Morfi

14 years ago
> > echo "foobar"["foo"][0];
"foobar"["foo"] - Why not "undefined index"? On Tue, Dec 13, 2011 at 10:20 AM, Nikita Popov <nikita.ppv@googlemail.com>wrote:

Ivan Enderlin @ Hoa

14 years ago
Hi all, On Tue Dec 13 09:32:43 2011, Morfi wrote:
>> >> echo "foobar"["foo"][0]; > > > "foobar"["foo"] - Why not "undefined index"?
Exactly. The index/key "foo" does not really exist in the string "foobar" because a string is more an indexed array of characters than a combination of substrings (as the key "foo" could suggest). "foobar"[3] has a well-defined meaning, but "foobar"["foo"] sounds strange for me :-). Which semantics do you attached to this syntax? Cheers.
-- Ivan Enderlin Developer of Hoa http://hoa.42/ or http://hoa-project.net/ PhD. student at LIFC/DISC (Vesontio) and INRIA (Cassis) http://lifc.univ-fcomte.fr/ and http://www.inria.fr/ Member of HTML and WebApps Working Group of W3C http://w3.org/

Laruence

14 years ago
Hi: should consistent with : <?php $a = "string"; echo $a["foo"][0]; in 5.4. thanks On Tue, Dec 13, 2011 at 4:32 PM, Morfi <i@morfi.ru> wrote:
>> >> echo "foobar"["foo"][0]; > > > "foobar"["foo"] - Why not "undefined index"? > > On Tue, Dec 13, 2011 at 10:20 AM, Nikita Popov <nikita.ppv@googlemail.com>wrote: > >> This can't go into PHP 5.4.0 in any case, because it is a feature >> addition and the release is already in RC. >> >> Nikita >> >> On Tue, Dec 13, 2011 at 7:16 AM, Laruence <laruence@php.net> wrote: >> > Hi: >> >    Call for voting about the const array/string derefernce RFC now. >> > >> >    you can find more info here: >> https://wiki.php.net/rfc/constdereference#vote >> > >> > >> > thanks >> > >> > -- >> > Laruence  Xinchen Hui >> > http://www.laruence.com/ >> > >> > -- >> > 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 >> >>
-- Laruence  Xinchen Hui http://www.laruence.com/

Laruence

14 years ago
Hi: thanks for pointing this out. yes, maybe 5.4.1 thanks On Tue, Dec 13, 2011 at 2:20 PM, Nikita Popov <nikita.ppv@googlemail.com> wrote:
> This can't go into PHP 5.4.0 in any case, because it is a feature > addition and the release is already in RC. > > Nikita > > On Tue, Dec 13, 2011 at 7:16 AM, Laruence <laruence@php.net> wrote: >> Hi: >>    Call for voting about the const array/string derefernce RFC now. >> >>    you can find more info here: https://wiki.php.net/rfc/constdereference#vote >> >> >> thanks >> >> -- >> Laruence  Xinchen Hui >> http://www.laruence.com/ >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >>
-- Laruence  Xinchen Hui http://www.laruence.com/

Patrick ALLAERT

14 years ago
2011/12/13 Nikita Popov <nikita.ppv@googlemail.com>:
> This can't go into PHP 5.4.0 in any case, because it is a feature > addition and the release is already in RC.
+1 @Laruence Can you remove the voting widget?

Pierre Joye

14 years ago
On Tue, Dec 13, 2011 at 2:37 PM, Patrick ALLAERT <patrickallaert@php.net> wrote:
> 2011/12/13 Nikita Popov <nikita.ppv@googlemail.com>: >> This can't go into PHP 5.4.0 in any case, because it is a feature >> addition and the release is already in RC. > > +1 > > @Laruence > Can you remove the voting widget?
I would reset the vote and make the vote for this change to apply to trunk instead. There is no reason to delay this decision, even if it is too late for 5.4 :) Cheers,
-- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org

Laruence

14 years ago
On Tue, Dec 13, 2011 at 9:59 PM, Pierre Joye <pierre.php@gmail.com> wrote:
> On Tue, Dec 13, 2011 at 2:37 PM, Patrick ALLAERT <patrickallaert@php.net> wrote: >> 2011/12/13 Nikita Popov <nikita.ppv@googlemail.com>: >>> This can't go into PHP 5.4.0 in any case, because it is a feature >>> addition and the release is already in RC. >> >> +1 >> >> @Laruence >> Can you remove the voting widget? > > I would reset the vote and make the vote for this change to apply to > trunk instead. > > There is no reason to delay this decision, even if it is too late for 5.4 :) > > Cheers, > -- > Pierre > > @pierrejoye | http://blog.thepimp.net | http://www.libgd.org
only for trunk? thanks
-- Laruence  Xinchen Hui http://www.laruence.com/

Laruence

14 years ago
On Tue, Dec 13, 2011 at 9:59 PM, Pierre Joye <pierre.php@gmail.com> wrote:
> On Tue, Dec 13, 2011 at 2:37 PM, Patrick ALLAERT <patrickallaert@php.net> wrote: >> 2011/12/13 Nikita Popov <nikita.ppv@googlemail.com>: >>> This can't go into PHP 5.4.0 in any case, because it is a feature >>> addition and the release is already in RC. >> >> +1 >> >> @Laruence >> Can you remove the voting widget? > > I would reset the vote and make the vote for this change to apply to > trunk instead. > > There is no reason to delay this decision, even if it is too late for 5.4 :) > > Cheers, > -- > Pierre > > @pierrejoye | http://blog.thepimp.net | http://www.libgd.org
Hi, done, now only voting for trunk :) thanks
-- Laruence  Xinchen Hui http://www.laruence.com/

Pierre Joye

14 years ago
post again as a top thread with this point being clarified please :) On Wed, Dec 14, 2011 at 12:19 PM, Laruence <laruence@php.net> wrote:
> On Tue, Dec 13, 2011 at 9:59 PM, Pierre Joye <pierre.php@gmail.com> wrote: >> On Tue, Dec 13, 2011 at 2:37 PM, Patrick ALLAERT <patrickallaert@php.net> wrote: >>> 2011/12/13 Nikita Popov <nikita.ppv@googlemail.com>: >>>> This can't go into PHP 5.4.0 in any case, because it is a feature >>>> addition and the release is already in RC. >>> >>> +1 >>> >>> @Laruence >>> Can you remove the voting widget? >> >> I would reset the vote and make the vote for this change to apply to >> trunk instead. >> >> There is no reason to delay this decision, even if it is too late for 5.4 :) >> >> Cheers, >> -- >> Pierre >> >> @pierrejoye | http://blog.thepimp.net | http://www.libgd.org > > Hi, done, now only voting for trunk :) > > thanks > > -- > Laruence  Xinchen Hui > http://www.laruence.com/
-- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org

Laruence

14 years ago
Hi: I have reset the vote, only vote for trunk now. https://wiki.php.net/rfc/constdereference thanks On Wed, Dec 14, 2011 at 7:25 PM, Pierre Joye <pierre.php@gmail.com> wrote:
> post again as a top thread with this point being clarified please :) > > On Wed, Dec 14, 2011 at 12:19 PM, Laruence <laruence@php.net> wrote: >> On Tue, Dec 13, 2011 at 9:59 PM, Pierre Joye <pierre.php@gmail.com> wrote: >>> On Tue, Dec 13, 2011 at 2:37 PM, Patrick ALLAERT <patrickallaert@php.net> wrote: >>>> 2011/12/13 Nikita Popov <nikita.ppv@googlemail.com>: >>>>> This can't go into PHP 5.4.0 in any case, because it is a feature >>>>> addition and the release is already in RC. >>>> >>>> +1 >>>> >>>> @Laruence >>>> Can you remove the voting widget? >>> >>> I would reset the vote and make the vote for this change to apply to >>> trunk instead. >>> >>> There is no reason to delay this decision, even if it is too late for 5.4 :) >>> >>> Cheers, >>> -- >>> Pierre >>> >>> @pierrejoye | http://blog.thepimp.net | http://www.libgd.org >> >> Hi, done, now only voting for trunk :) >> >> thanks >> >> -- >> Laruence  Xinchen Hui >> http://www.laruence.com/ > > > > -- > Pierre > > @pierrejoye | http://blog.thepimp.net | http://www.libgd.org
-- Laruence  Xinchen Hui http://www.laruence.com/

Stas Malyshev

14 years ago
Hi!
> Hi: > I have reset the vote, only vote for trunk now. > > https://wiki.php.net/rfc/constdereference >
What happens in your patch if something like ['foo', 'bar'][1] is used in write context?
-- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227

Laruence

14 years ago
On Tue, Dec 27, 2011 at 4:38 PM, Stas Malyshev <smalyshev@sugarcrm.com> wrote:
> Hi! > > >> Hi: >>    I have reset the vote, only vote for trunk now. >> >>    https://wiki.php.net/rfc/constdereference >> > > What happens in your patch if something like ['foo', 'bar'][1] is used in > write context? >
this patch will not allow that, in write context lead to syntax error.
> -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >
-- Laruence  Xinchen Hui http://www.laruence.com/

Oleg Oshmyan

14 years ago
> Call for voting about the const array/string derefernce RFC now. > > you can find more info here: > https://wiki.php.net/rfc/constdereference#vote
I have always wondered why array dereference does not just work on arbitrary expressions in PHP like other operators do. Even with the latest modification that allows dereferencing function calls, this works: md5('')[0] but this results in a parse error (syntax error, unexpected '['): (md5(''))[0] Then there are expressions like ('a'.'b')[0], all sorts of combinations of operators... Why not just treat any 'expression[expression]' as an array dereference as other languages do?
>> echo "foobar"["foo"][0]; > > "foobar"["foo"] - Why not "undefined index"?
"foo" is converted to an integer, yielding zero. 'Undefined index' seems to make more sense to me but PHP 5.3 behaves the same way.
-- Oleg