3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $kms =300; $litres=40; function calc_milege() { $result=$GLOBAL['kms']/$GLOBAL['litres']; return $result; } $c=calc_milege(); print "milege=".$c;
Output for 7.0.0 - 7.2.0
Notice: Undefined variable: GLOBAL in /in/p2J85 on line 7 Notice: Undefined variable: GLOBAL in /in/p2J85 on line 7 Warning: Division by zero in /in/p2J85 on line 7 milege=NAN
Output for 5.3.18 - 5.6.21
Notice: Undefined variable: GLOBAL in /in/p2J85 on line 7 Notice: Undefined variable: GLOBAL in /in/p2J85 on line 7 Warning: Division by zero in /in/p2J85 on line 7 milege=