note 122237 deleted from internals2.opcodes.add by cmb
| From: | cmb@php.net | Date: | Sun, 10 Jan 2021 13:17:34 +0000 |
| Subject: | note 122237 deleted from internals2.opcodes.add by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-216091@lists.php.net to get a copy of this message | ||
Note Submitter: jcastromail at yahoo dot es
----
For you information
Using +0 for casting a string into a integer works but it generates a warning in php 7.1+
PHP 5.X: "abc"+0 = 0
PHP 7.0: "abc"+0 = 0
PHP 7.1: "abc"+0 = 0 (Warning: A non-numeric value encountered in..)
The correct way (if you are using it for casting) is to do
PHP 7.1: (int)"abc" = 0