Home  >  Article  >  Backend Development  >  php7 performance test

php7 performance test

WBOY
WBOYOriginal
2016-07-28 08:29:141281browse

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.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn