Home > Article > Backend Development > php7 performance test
The execution code is as follows:
$start_time = microtime(true);
$a = array();
for($i=0;$i<90000;$i++){
$a[$i] = $i;
}
foreach($a as $i)
{
array_key_exists($i, $a);
in_array($i, $a);
}
$end_time = microtime(true);
echo "use time=".($end_time - $start_time);
in Time spent on php5.5.30:use time=68.47440290451
It takes time to execute after installing php7 in the virtual machine
use time=8.4918169975281
The above has introduced the php7 performance test, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.