3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump('1.5'+' 2'); var_dump('1.5'+' a'); var_dump('1.5'+(float)' 2a'); var_dump('1.5'+' 2a'); var_dump('1.5'+(float)' 2a');
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
float(3.5) Fatal error: Uncaught TypeError: Unsupported operand types: string + string in /in/asKq9:3 Stack trace: #0 {main} thrown in /in/asKq9 on line 3
Process exited with code 255.
Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
float(3.5) Warning: A non-numeric value encountered in /in/asKq9 on line 3 float(1.5) float(3.5) Notice: A non well formed numeric value encountered in /in/asKq9 on line 5 float(3.5) float(3.5)
Output for 7.3.32 - 7.3.33
float(3.5) Warning: A non-numeric value encountered in /in/asKq9 on line 3 float(1.5) float(3.5) float(3.5) float(3.5)
Output for 5.6.0 - 5.6.29, 7.0.0 - 7.0.20
float(3.5) float(1.5) float(3.5) float(3.5) float(3.5)

preferences:
168.25 ms | 402 KiB | 193 Q