3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $chi=0; function asy($val){ echo $val+1; $chi+=1; } $x=array(); $x[0]=asy; echo $chi; echo $x[0](6); echo $x[0](12); echo $chi; ?>
based on KiGUv
Output for 7.2.0
Warning: Use of undefined constant asy - assumed 'asy' (this will throw an Error in a future version of PHP) in /in/pdW7b on line 8 07 Notice: Undefined variable: chi in /in/pdW7b on line 5 13 Notice: Undefined variable: chi in /in/pdW7b on line 5 0
Output for 5.3.18 - 7.1.10
Notice: Use of undefined constant asy - assumed 'asy' in /in/pdW7b on line 8 07 Notice: Undefined variable: chi in /in/pdW7b on line 5 13 Notice: Undefined variable: chi in /in/pdW7b on line 5 0