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 fdibo
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0rc3
Notice: Undefined variable: id in /in/6jDeJ on line 4 Notice: Undefined index: in /in/6jDeJ on line 4 Не указано
Output for hhvm-3.15.4
Notice: Undefined variable: id in /in/6jDeJ on line 4 Notice: Undefined variable: id in /in/6jDeJ on line 4 Notice: Undefined index: in /in/6jDeJ on line 4 Не указано