I noticed that code below results in different messages in PHP 5.x and 7:
if ('0xFF' == 255) {
echo 'Equal';
} else {
echo 'Not equal';
}
Tried to find a description of the changes that cause it in migration guide and in the PHP doc but couldn't find anything. Probably it is somewhere there and I just missed it. Can you, please, point it? Thank you!
Where I looked
The PHP development team released the latest version of PHP: PHP 7 claiming it to be twice as fast as its predecessor PHP 5.
PHP is powered by Zend Engine even since the release of PHP 4. PHP 5 uses Zend II but PHP 7 uses a brand new model of engine called PHPNG or Next Generation. This new PHPNG engine improves the performance as much as twice with optimized memory usage. This has been proved by the benchmark provided by the company.
Why PHP 7 is faster? PHP 7 runs on the PHPNG engine (or Zend Engine 3.0) that speeds up PHP apps more than the previous PHP interpreter (Zend Engine 2.0). Thanks to PHPNG, your applications will perform 2x faster and has 50% better memory consumption than PHP 5.6.
Upgrading to PHP7 not only ensures fast website loading but also far efficient scripting that runs flawlessly every time users access the website. Therefore, if businesses choose to upgrade their websites from PHP5 to PHP7, it would be beneficial for their businesses to grow.
It's here: http://php.net/manual/en/migration70.incompatible.php
Changes to String Handling
Hexadecimal strings are no longer considered numeric
Strings containing hexadecimal numbers are no longer considered to be numeric. For example:
<?php var_dump("0x123" == "291");
etc...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With