3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function s($rad){ return M_PI*(pow($rad/2,2)); } $r1=4; $r2=10; $r3=22; echo s($r1)."<br>"; $a=$r2; echo s(a)."<br>"; echo s(22); ?>
based on IkgmO
Output for 7.2.0 - 7.3.0rc3
12.566370614359<br> Warning: Use of undefined constant a - assumed 'a' (this will throw an Error in a future version of PHP) in /in/t9TiV on line 10 Warning: A non-numeric value encountered in /in/t9TiV on line 3 0<br>380.13271108436
Output for 7.1.0 - 7.1.23
12.566370614359<br> Notice: Use of undefined constant a - assumed 'a' in /in/t9TiV on line 10 Warning: A non-numeric value encountered in /in/t9TiV on line 3 0<br>380.13271108436
Output for 5.6.38 - 7.0.28
12.566370614359<br> Notice: Use of undefined constant a - assumed 'a' in /in/t9TiV on line 10 0<br>380.13271108436