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", $userInfo);
based on 6jDeJ
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0rc6
Notice: Undefined variable: id in /in/OvL3k on line 4 Notice: Undefined index: in /in/OvL3k on line 4 Не указано
Output for hhvm-3.15.4
Notice: Undefined variable: id in /in/OvL3k on line 4 Notice: Undefined variable: id in /in/OvL3k on line 4 Notice: Undefined index: in /in/OvL3k on line 4 Не указано