3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //$var = 'A'; //$var = ''; //$var = null; $var = 0; $f1 = function($var) { if (! isset($var) || $var) { //echo "set default"; //"not empty or not defiend or a null value"; } else { //echo "not default"; //"empty"; } } $f2 = function($var) { if (! isset($var) || ! empty($var)) { //echo "set default"; } else { //echo "not default"; } } $s = microtime(1); for ($i = 0; $i < 100; $i++) { $f1($var); } echo microtime(1) - $s;
Output for 5.4.0 - 5.5.3
Parse error: syntax error, unexpected '$f2' (T_VARIABLE) in /in/iYdb0 on line 14
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_VARIABLE in /in/iYdb0 on line 14
Process exited with code 255.