3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php define('NUM_ITERATIONS', 10000000); $var = NULL; // Profile is_null. $time = time(); for ($i = 0; $i < NUM_ITERATIONS; $i++) { is_null($var); } print (time() - $time) . ' elapsed seconds.' . PHP_EOL; // Profile (bool) $time = time(); for ($i = 0; $i < NUM_ITERATIONS; $i++) { (bool) $var; } print (time() - $time) . ' elapsed seconds.' . PHP_EOL; // Profile isset $time = time(); for ($i = 0; $i < NUM_ITERATIONS; $i++) { isset($var); } print (time() - $time) . ' elapsed seconds.' . PHP_EOL;
based on 3s3ZA
Output for 7.1.7, 7.2.0
1 elapsed seconds. 0 elapsed seconds. 0 elapsed seconds.
Output for 7.0.0 - 7.0.10, 7.1.0, 7.1.6, 7.1.10
0 elapsed seconds. 0 elapsed seconds. 0 elapsed seconds.
Output for 5.5.6, 5.5.14, 5.5.24 - 5.5.25, 5.5.27, 5.5.34, 5.5.37, 5.6.1, 5.6.3, 5.6.6, 5.6.12, 5.6.19 - 5.6.21, 7.0.20, 7.1.5
0 elapsed seconds. 0 elapsed seconds. 1 elapsed seconds.
Output for 5.5.0 - 5.5.5, 5.5.7 - 5.5.13, 5.5.15 - 5.5.23, 5.5.26, 5.5.28 - 5.5.33, 5.5.35 - 5.5.36, 5.5.38 - 5.6.0, 5.6.2, 5.6.4 - 5.6.5, 5.6.7 - 5.6.11, 5.6.13 - 5.6.18, 5.6.22 - 5.6.28
0 elapsed seconds. 1 elapsed seconds. 0 elapsed seconds.