Le 10/02/2016 15:34, Dan Ackroyd a écrit :
On 10 February 2016 at 07:00, Yasuo Ohgaki <yohg...@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.
Sure. All of this is interesting, but out of scope for this RFC.
My initial question was just about the fact that empty strings are not
handled like other strings, regarding offset assignments (empty strings
are silently converted to arrays).
Regards
François
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php