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;
based on K2GPb
Output for 7.2.0
Warning: Use of undefined constant calc_milege - assumed 'calc_milege' (this will throw an Error in a future version of PHP) in /in/KvgfY on line 10 milege=calc_milege
Output for 5.3.18 - 7.1.10
Notice: Use of undefined constant calc_milege - assumed 'calc_milege' in /in/KvgfY on line 10 milege=calc_milege