Hi,
A new RFC for PHP7 : https://wiki.php.net/rfc/array-to-string
Not implemented yet, but the PR is available for comments :
https://github.com/php/php-src/pull/991
Regards
François
I would vote for the first option and entirely deprecate the array to
string conversion. As far as I can see there is no real world use-case for
it and most of the time it does more harm than good.
Stelian
On Sun, Jan 11, 2015 at 2:29 PM, F & N Laupretre nf.laupretre@yahoo.fr
wrote:
Hi,
A new RFC for PHP7 : https://wiki.php.net/rfc/array-to-string
Not implemented yet, but the PR is available for comments :
https://github.com/php/php-src/pull/991Regards
François
Hi,
A new RFC for PHP7 : https://wiki.php.net/rfc/array-to-string
The voting options are missing in there. They should (probably) be:
- don't change
- 1st alternative
- 2nd alternative
cheers,
Derick
Fixed. Thanks
-----Message d'origine-----
De : Derick Rethans [mailto:derick@php.net]
Envoyé : mardi 13 janvier 2015 13:01
À : F & N Laupretre
Cc : internals@lists.php.net
Objet : Re: [PHP-DEV] [RFC] Improve array to string conversionHi,
A new RFC for PHP7 : https://wiki.php.net/rfc/array-to-string
The voting options are missing in there. They should (probably) be:
- don't change
- 1st alternative
- 2nd alternative
cheers,
Derick
Le Sun Jan 11 2015 at 14:30:42, F & N Laupretre nf.laupretre@yahoo.fr a
écrit :
Hi,
A new RFC for PHP7 : https://wiki.php.net/rfc/array-to-string
Not implemented yet, but the PR is available for comments :
https://github.com/php/php-src/pull/991Regards
François
Just for the record, when I implemented the E_NOTICE
on that conversion I
received lot of complaints of users using (incorrectly) the array_diff()
family which internally compare all sub-elements given their "string"
representation. It means that if you present something for "option 3" you
also have to think about the way those functions will behave (and the
possible BC introduced.
Note the exact same behavior with multi dimensional arrays containing same
/ different content:
// Same sub-array
php > var_dump( array_diff( [['a']], [['a']] ) );
PHP Notice: Array to string conversion in php shell code on line 1
array(0) {
}
// Different sub-array
php > var_dump( array_diff( [['a']], [['42']] ) );
PHP Notice: Array to string conversion in php shell code on line 1
array(0) {
}
My 0.02€.
Patrick