3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "Sum: " . 1 + 2; echo "Hello " . isset($name) ? $name : "John Doe" . "!";
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
Sum: 3 Warning: Undefined variable $name in /in/Rgp73 on line 4
Output for 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /in/Rgp73 on line 3 Warning: A non-numeric value encountered in /in/Rgp73 on line 3 2 Notice: Undefined variable: name in /in/Rgp73 on line 4
Output for 7.3.32, 7.4.26
Warning: A non-numeric value encountered in /in/Rgp73 on line 3 2
Output for 7.3.0 - 7.3.31, 7.3.33
Warning: A non-numeric value encountered in /in/Rgp73 on line 3 2 Notice: Undefined variable: name in /in/Rgp73 on line 4

preferences:
160.42 ms | 410 KiB | 5 Q