3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tests = array( '$empty' => array(), '$full' => range(1, 10), ); $count = 10 * 1000 * 1000; foreach ($tests as $name => $array) { printf("%-10s", $name); $start = microtime(true); $i = $count; while ($i-- > 0) { (bool) $array; } $total = microtime(true) - $start; printf("%.2F sec total, %.4F sec/iter\n", $total, $total / $count); }
Output for 7.1.0
$empty 0.21 sec total, 0.0000 sec/iter $full 0.17 sec total, 0.0000 sec/iter
Output for 7.0.14
$empty 0.16 sec total, 0.0000 sec/iter $full 0.15 sec total, 0.0000 sec/iter
Output for 5.4.17, 5.4.27
$empty 0.49 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.26
$empty 0.52 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.25
$empty 0.73 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.0, 5.4.4, 5.4.24
$empty 0.45 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.22 - 5.4.23
$empty 0.81 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.2, 5.4.5 - 5.4.6, 5.4.16, 5.4.19, 5.4.21
$empty 0.48 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.20
$empty 0.71 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.10, 5.4.14, 5.4.18
$empty 0.83 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.15
$empty 0.93 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.13
$empty 0.96 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.12
$empty 1.02 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.11
$empty 1.01 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.9
$empty 1.23 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.8
$empty 0.89 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.7
$empty 0.86 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.3
$empty 0.69 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.1
$empty 0.54 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.0, 5.3.28
$empty 0.62 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.8, 5.3.27
$empty 1.22 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.5, 5.3.7, 5.3.16, 5.3.26
$empty 0.63 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.9, 5.3.14, 5.3.20, 5.3.23 - 5.3.25
$empty 0.65 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.22
$empty 1.21 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.21
$empty 1.19 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.6, 5.3.10, 5.3.19
$empty 0.67 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.4, 5.3.17 - 5.3.18
$empty 0.77 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.15
$empty 1.27 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.13
$empty 1.13 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.12
$empty 1.16 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.11
$empty 1.26 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.3
$empty 1.15 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.2
$empty 1.14 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.1
$empty 0.64 sec total, 0.0000 sec/iter $full
Process exited with code 137.