3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = deg2rad(90); $b =cos(a); var_export($a); var_export($b); echo "\n".sprintf('%F', $a)."\n";
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Undefined constant "a" in /in/kCDdC:3 Stack trace: #0 {main} thrown in /in/kCDdC on line 3
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: Use of undefined constant a - assumed 'a' (this will throw an Error in a future version of PHP) in /in/kCDdC on line 3 Warning: cos() expects parameter 1 to be float, string given in /in/kCDdC on line 3 1.5707963267948966NULL 1.570796
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.25
Notice: Use of undefined constant a - assumed 'a' in /in/kCDdC on line 3 Warning: cos() expects parameter 1 to be float, string given in /in/kCDdC on line 3 1.5707963267948966NULL 1.570796
Output for 5.5.6 - 5.5.38, 5.6.0 - 5.6.38
Notice: Use of undefined constant a - assumed 'a' in /in/kCDdC on line 3 Warning: cos() expects parameter 1 to be double, string given in /in/kCDdC on line 3 1.5707963267948966NULL 1.570796
Output for 5.5.0 - 5.5.5
Notice: Use of undefined constant a - assumed 'a' in /in/kCDdC on line 3 Warning: cos() expects parameter 1 to be double, string given in /in/kCDdC on line 3 1.5707963267949NULL 1.570796

preferences:
229.42 ms | 402 KiB | 293 Q