Par Remi le samedi 11 juin 2016, 09:40 - Développement - Lien permanent

PHP 7.1 introduce a new check during conversion of string to number .

Example :

$ module load php70 $ php -v PHP 7.0.8RC1 (cli) (built: Jun 8 2016 06:25:44) ( NTS ) $ php -r 'var_dump("1K" * 1024);' int(1024) $ module load php71 $ php -v PHP 7.1.0alpha1 (cli) (built: Jun 8 2016 09:36:05) ( NTS ) $ php -r 'var_dump("1K" * 1024);' PHP Notice: A non well formed numeric value encountered in Command line code on line 1 int(1024)

See it on 3v4l.org.

It is obvious that this new message is useful, but such code is very common.

Some examples in real projects:

GLPI in toolbox (suffix) or in dropdown (empty string)

jquery-file-upload see PR #3451

You can start checking your code ;)