3v4l.org

run code in 200+ PHP versions simultaneously
<?php $a = 1; $b = 0; // проверьте $b = null; $b = "0"; $b = 0.2; .. try { if((float) $b === 0.0) throw new Exception('деление на ноль'); echo ($a / $b); } catch(Throwable $e) { echo $e->getMessage(); }
Output for 7.0.0 - 7.4.0
деление на ноль
Output for 5.1.0 - 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'деление на ноль' in /in/ORXUi:8 Stack trace: #0 {main} thrown in /in/ORXUi on line 8
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Class 'Throwable' not found in /in/ORXUi on line 12
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/ORXUi on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '{' in /in/ORXUi on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/ORXUi on line 6
Process exited with code 255.