Re: [RFC] Generalize support of negative string offsets
| From: | Dan Ackroyd | Date: | Wed, 10 Feb 2016 14:34:54 +0000 |
| Subject: | Re: [RFC] Generalize support of negative string offsets | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-91183@lists.php.net to get a copy of this message | ||
On 10 February 2016 at 07:00, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
> Additional comment on this
>
> php > $v=array(1,2,3);
> php > $v .= 'abc';
>
> I think $v .= 'abc' should not destroy array variable. It's minor issue, though.
That is the current behaviour. Trying to slip "bug fixes" into RFCs is
a very bad pattern to follow.
If this should be fixed, it should be done as part of a separate RFC.
> This insane string assignment raises E_NOTICE. PHP may be better to
> raise E_WARNING for this kind of invalid assignments just like
François already wrote an RFC for this
https://wiki.php.net/rfc/array-to-string that
passed, but apparently
could not be implemented safely, which is a shame. That RFC needs to
be resurrected imo. But again, changing that behaviour needs to be
separate, and not part of this RFC.
cheers
Dan