3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); var_dump('17.123' + '19.456'); var_dump('17 .123' + '19.456'); var_dump('17,123' + '19.456'); var_dump('1,700.123' + '19.456'); $currentLocale = setlocale(LC_ALL, 0); setlocale(LC_ALL, "en_DK.UTF-8"); var_dump('1,700.123' + '19.456'); setlocale(LC_ALL, $currentLocale); var_dump('17e123' + '19.456'); var_dump('hello' + '19.456');
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.25, 8.4.1 - 8.4.12
float(36.579) Warning: A non-numeric value encountered in /in/iMGg8 on line 8 float(36.456) Warning: A non-numeric value encountered in /in/iMGg8 on line 9 float(36.456) Warning: A non-numeric value encountered in /in/iMGg8 on line 10 float(20.456) Warning: A non-numeric value encountered in /in/iMGg8 on line 14 float(20.456) float(1.7E+124) Fatal error: Uncaught TypeError: Unsupported operand types: string + string in /in/iMGg8:18 Stack trace: #0 {main} thrown in /in/iMGg8 on line 18
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
float(36.579) Notice: A non well formed numeric value encountered in /in/iMGg8 on line 8 float(36.456) Notice: A non well formed numeric value encountered in /in/iMGg8 on line 9 float(36.456) Notice: A non well formed numeric value encountered in /in/iMGg8 on line 10 float(20.456) Notice: A non well formed numeric value encountered in /in/iMGg8 on line 14 float(20.456) float(1.7E+124) Warning: A non-numeric value encountered in /in/iMGg8 on line 18 float(19.456)
Output for 7.3.32 - 7.3.33
float(36.579) float(36.456) float(36.456) float(20.456) float(20.456) float(1.7E+124) Warning: A non-numeric value encountered in /in/iMGg8 on line 18 float(19.456)

preferences:
142.27 ms | 409 KiB | 5 Q