3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump("a" - "b"); var_dump("2a" - "b"); var_dump("a" - "1b"); var_dump("2a" - "1b");
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 TypeError: Unsupported operand types: string - string in /in/t7pvD:2 Stack trace: #0 {main} thrown in /in/t7pvD on line 2
Process exited with code 255.
Output for 7.1.0 - 7.1.23, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
Warning: A non-numeric value encountered in /in/t7pvD on line 2 Warning: A non-numeric value encountered in /in/t7pvD on line 2 int(0) Notice: A non well formed numeric value encountered in /in/t7pvD on line 3 Warning: A non-numeric value encountered in /in/t7pvD on line 3 int(2) Warning: A non-numeric value encountered in /in/t7pvD on line 4 Notice: A non well formed numeric value encountered in /in/t7pvD on line 4 int(-1) Notice: A non well formed numeric value encountered in /in/t7pvD on line 5 Notice: A non well formed numeric value encountered in /in/t7pvD on line 5 int(1)
Output for 7.3.32 - 7.3.33
Warning: A non-numeric value encountered in /in/t7pvD on line 2 Warning: A non-numeric value encountered in /in/t7pvD on line 2 int(0) Warning: A non-numeric value encountered in /in/t7pvD on line 3 int(2) Warning: A non-numeric value encountered in /in/t7pvD on line 4 int(-1) int(1)
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.0 - 7.0.31
int(0) int(2) int(-1) int(1)

preferences:
240.36 ms | 402 KiB | 332 Q