|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-03-31 23:03 UTC] danack@php.net
-Status: Open
+Status: Feedback
[2016-03-31 23:03 UTC] danack@php.net
[2016-04-01 02:15 UTC] jacky at xsteach dot com
-Status: Feedback
+Status: Closed
[2016-04-01 02:15 UTC] jacky at xsteach dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 09:00:01 2025 UTC |
Description: ------------ Bit operation on php 5.6+ is lower performance than php 5.5-. php5.5 is faster 3x+ than php5.6 and php7.0. $ php5 -v PHP 5.5.31 (cli) (built: Feb 20 2016 20:33:10) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies $php5 demo.php Done in 0.047697067260742 seconds $ php -v PHP 5.6.19 (cli) (built: Mar 6 2016 14:18:03) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Retinas $ php demo.php Done in 0.15873312950134 seconds $ php7 -v PHP 7.0.4 (cli) (built: Mar 6 2016 14:30:59) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies with Xdebug v2.4.0RC4-dev, Copyright (c) 2002-2015, by Derick Rethans $ php7 demo.php Done in 0.10964512825012 seconds Test script: --------------- <?php function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } $time_start = microtime_float(); $i = 1920 * 1080; $a = 1; while ($i--) { $a << 1; } $time_end = microtime_float(); $time = $time_end - $time_start; echo "Done in $time seconds\n"; Expected result: ---------------- Bit operation on php7.0 as faster as php5.5 or even better. Actual result: -------------- Low performance with bit operation on php7.0.