3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $userInfo = array('sex' => 2, 'city' => '0'); function isNull($Id, $userInfo){ If($userInfo[$id] == 0){ echo "Не указано"; } else{ echo $userInfo[$id]; } } isNull(city);
based on st8mf
Output for 7.2.0 - 7.3.0rc3
Warning: Use of undefined constant city - assumed 'city' (this will throw an Error in a future version of PHP) in /in/HZinf on line 12 Fatal error: Uncaught ArgumentCountError: Too few arguments to function isNull(), 1 passed in /in/HZinf on line 12 and exactly 2 expected in /in/HZinf:3 Stack trace: #0 /in/HZinf(12): isNull('city') #1 {main} thrown in /in/HZinf on line 3
Process exited with code 255.
Output for 7.1.0 - 7.1.20
Notice: Use of undefined constant city - assumed 'city' in /in/HZinf on line 12 Fatal error: Uncaught ArgumentCountError: Too few arguments to function isNull(), 1 passed in /in/HZinf on line 12 and exactly 2 expected in /in/HZinf:3 Stack trace: #0 /in/HZinf(12): isNull('city') #1 {main} thrown in /in/HZinf on line 3
Process exited with code 255.
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.0.20
Notice: Use of undefined constant city - assumed 'city' in /in/HZinf on line 12 Warning: Missing argument 2 for isNull(), called in /in/HZinf on line 12 and defined in /in/HZinf on line 3 Notice: Undefined variable: userInfo in /in/HZinf on line 4 Notice: Undefined variable: id in /in/HZinf on line 4 Не указано
Output for hhvm-3.15.4
Notice: Use of undefined constant city - assumed 'city' in /in/HZinf on line 12 Warning: isNull() expects exactly 2 parameters, 1 given in /in/HZinf on line 4 Notice: Undefined variable: userInfo in /in/HZinf on line 4 Notice: Undefined variable: id in /in/HZinf on line 4 Notice: Undefined variable: id in /in/HZinf on line 4 Не указано