Re: deprecation status of $str{42} versus $str[42]

From: Date: Sat, 14 Jun 2008 13:55:28 +0000
Subject: Re: deprecation status of $str{42} versus $str[42]
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-38210@lists.php.net to get a copy of this message
On Saturday 14 June 2008 15:26:20 Lukas Kahwe Smith wrote: > On 11.06.2008, at 01:15, Jani Taskinen wrote: > > Correct me if I'm wrong but wasn't that the last decision we made > > about it the last time this was brought up? Just undocument it. > > Totally. It exists, only works with strings (right?! :) and is not > > recommended. So simply make it disappear from the docs. "See no > > evil, hear no evil, speak no evil.." ;) > > I do not know the decision (anyone who cares about decisions being > remembered should write an RFC nowadays), but I think what Jani is > saying sounds reasonable to me. > > regards, > Lukas Kahwe Smith > mls@pooteeweet.org et@edea:~> php -r '$array = array("bar"); echo $array{0},"\n";' bar So, no "only works with strings". And it has been the preferred way to deal with string offsets for years. Undocumenting it will mean a feature that is used quite a bit because of this is not to be found in the documentation. Not really a good idea. Regards, Stefan

« previous php.internals (#38210) next »