Le Sun Jan 11 2015 at 14:30:42, F & N Laupretre <nf.laupre...@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/991
>
> Regards
>
> 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

Reply via email to