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 Lk5Bt
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/fdibo on line 12 Notice: Undefined variable: id in /in/fdibo on line 4 Notice: Undefined index: in /in/fdibo on line 4 Не указано
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.20
Notice: Use of undefined constant city - assumed 'city' in /in/fdibo on line 12 Notice: Undefined variable: id in /in/fdibo on line 4 Notice: Undefined index: in /in/fdibo on line 4 Не указано
Output for hhvm-3.15.4
Notice: Use of undefined constant city - assumed 'city' in /in/fdibo on line 12 Notice: Undefined variable: id in /in/fdibo on line 4 Notice: Undefined variable: id in /in/fdibo on line 4 Notice: Undefined index: in /in/fdibo on line 4 Не указано