3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tests = array( '$empty' => array(), '$full' => range(1, 100), ); $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("%0.3F sec total, %0.4F sec/iter\n", $total, $total / $count); }
Output for 7.1.0
$empty 0.112 sec total, 0.0000 sec/iter $full 0.112 sec total, 0.0000 sec/iter
Output for 7.0.14
$empty 0.155 sec total, 0.0000 sec/iter $full 0.114 sec total, 0.0000 sec/iter
Output for 7.0.12
$empty 0.173 sec total, 0.0000 sec/iter $full 0.124 sec total, 0.0000 sec/iter
Output for 7.0.10
$empty 0.144 sec total, 0.0000 sec/iter $full 0.103 sec total, 0.0000 sec/iter
Output for 7.0.9
$empty 0.122 sec total, 0.0000 sec/iter $full 0.116 sec total, 0.0000 sec/iter
Output for 7.0.8
$empty 0.129 sec total, 0.0000 sec/iter $full 0.119 sec total, 0.0000 sec/iter
Output for 7.0.7
$empty 0.123 sec total, 0.0000 sec/iter $full 0.127 sec total, 0.0000 sec/iter
Output for 7.0.6
$empty 0.121 sec total, 0.0000 sec/iter $full 0.124 sec total, 0.0000 sec/iter
Output for 7.0.5
$empty 0.133 sec total, 0.0000 sec/iter $full 0.132 sec total, 0.0000 sec/iter
Output for 7.0.4
$empty 0.150 sec total, 0.0000 sec/iter $full 0.132 sec total, 0.0000 sec/iter
Output for 7.0.3
$empty 0.129 sec total, 0.0000 sec/iter $full 0.122 sec total, 0.0000 sec/iter
Output for 7.0.2
$empty 0.114 sec total, 0.0000 sec/iter $full 0.105 sec total, 0.0000 sec/iter
Output for 7.0.1
$empty 0.148 sec total, 0.0000 sec/iter $full 0.122 sec total, 0.0000 sec/iter
Output for 7.0.0
$empty 0.130 sec total, 0.0000 sec/iter $full 0.122 sec total, 0.0000 sec/iter
Output for 5.6.28
$empty 0.299 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.6.15, 5.6.25
$empty 0.494 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.6.19, 5.6.24
$empty 0.499 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.6.23
$empty 0.496 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.6.22
$empty 0.426 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.0, 5.6.21
$empty 0.511 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.6.20
$empty 0.450 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.15, 5.5.30, 5.5.38, 5.6.10, 5.6.18
$empty 0.501 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.6.17
$empty 0.503 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.6.16
$empty 0.513 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.6.14
$empty 0.490 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.6.13
$empty 0.551 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.6.12
$empty 0.506 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.6.11
$empty 0.502 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.6.9
$empty 0.495 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.6.8
$empty 0.562 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.6.7
$empty 0.531 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.6, 5.6.6
$empty 0.462 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.6.5
$empty 0.505 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.6.4
$empty 0.590 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.11, 5.6.3
$empty 0.504 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.6.2
$empty 0.457 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.6.1
$empty 0.414 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.16, 5.6.0
$empty 0.516 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.37
$empty 0.459 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.36
$empty 0.709 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.35
$empty 0.745 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.34
$empty 0.760 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.33
$empty 0.786 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.32
$empty 0.920 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.20, 5.5.5, 5.5.31
$empty 0.498 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.22, 5.5.29
$empty 0.921 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.28
$empty 0.944 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.27
$empty 0.770 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.26
$empty 0.937 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 4.4.2, 5.5.25
$empty 0.799 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.24
$empty 0.541 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.23
$empty 0.445 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.1.6, 5.5.21
$empty 0.734 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.20
$empty 0.759 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.6, 5.5.19
$empty 0.534 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.18
$empty 0.529 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.11, 5.5.14
$empty 0.419 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.13
$empty 0.705 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.12
$empty 0.754 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.10
$empty 0.740 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.9
$empty 0.449 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.8
$empty 0.554 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.7
$empty 0.442 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.4
$empty 0.804 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.3
$empty 0.737 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.5.1 - 5.5.2
$empty 0.524 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.45
$empty 0.409 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.44
$empty 1.034 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.35, 5.4.43
$empty 0.483 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.42
$empty 0.787 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.41
$empty 0.834 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.2 - 5.4.3, 5.4.29 - 5.4.30, 5.4.40
$empty 0.486 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.39
$empty 0.727 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.38
$empty 0.823 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.37
$empty 0.722 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.36
$empty 0.485 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.34
$empty 0.430 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.32
$empty 0.769 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.31
$empty 0.448 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.28
$empty 0.399 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.26 - 5.4.27
$empty 0.482 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.25
$empty 0.487 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.24
$empty 0.820 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.23
$empty 0.765 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.22
$empty 0.925 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.21
$empty 0.514 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.19
$empty 0.741 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.18
$empty 0.480 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.17
$empty 0.471 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.16
$empty 0.707 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.15
$empty 0.491 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.14
$empty 0.781 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.13
$empty 0.395 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.12
$empty 0.392 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.10
$empty 0.714 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.9
$empty 1.023 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.8
$empty 0.476 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.7
$empty 0.851 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.5
$empty 0.512 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.4
$empty 0.856 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.1
$empty 0.704 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.4.0
$empty 0.493 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.29
$empty 1.449 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.28
$empty 0.639 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.27
$empty 0.659 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.26
$empty 1.007 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.25
$empty 0.680 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.24
$empty 0.690 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.23
$empty 0.986 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.22
$empty 1.071 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.21
$empty 0.713 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.20
$empty 1.118 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.19
$empty 1.115 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.18
$empty 1.097 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.17
$empty 1.033 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 4.3.11, 5.3.16
$empty 0.651 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.15
$empty 0.733 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 4.3.10, 5.3.14
$empty 0.608 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.13
$empty 1.253 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.12
$empty 0.726 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.11
$empty 0.545 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.10
$empty 0.698 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.9
$empty 1.041 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.8
$empty 1.065 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.7
$empty 0.681 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.6
$empty 0.685 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.5
$empty 1.060 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.4
$empty 1.055 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.3
$empty 0.567 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.2
$empty 0.879 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.1
$empty 0.693 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.3.0
$empty 1.016 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.2.17
$empty 1.248 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.2.16
$empty 1.379 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.2.15
$empty 0.758 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.2.14
$empty 1.255 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.2.13
$empty 1.183 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.2.12
$empty 0.779 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 4.4.4, 5.2.11
$empty 0.778 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.2.10
$empty 0.821 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.2.7, 5.2.9
$empty 1.247 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.2.8
$empty 1.212 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.2.6
$empty 1.157 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.2.5
$empty 1.264 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.2.4
$empty 1.213 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.2.3
$empty 1.177 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.2.2
$empty 1.238 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.2.1
$empty 1.169 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.2.0
$empty 1.250 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.1.5
$empty 1.113 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.1.4
$empty 1.263 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.1.3
$empty 0.666 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.1.2
$empty 1.286 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.1.1
$empty 1.224 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.1.0
$empty 1.317 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.0.5
$empty 1.738 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.0.4
$empty 2.319 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 5.0.3
$empty 2.220 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.2
$empty sec total, sec/iter $full
Process exited with code 137.
Output for 4.4.9
$empty 0.172 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 4.4.8
$empty 0.807 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 4.4.7
$empty 0.061 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 4.4.6
$empty 0.764 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 4.4.5
$empty 0.995 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 4.4.3
$empty 0.801 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 4.4.1
$empty 0.165 sec total, 0.0000 sec/iter $full
Process exited with code 137.
Output for 4.4.0
$empty 0.753 sec total, 0.0000 sec/iter $full
Process exited with code 137.