3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=0); function a(float $a) { var_dump($a); } a(1); a(1.1); a("12"); a("banana");
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
float(1) float(1.1) float(12) Fatal error: Uncaught TypeError: a(): Argument #1 ($a) must be of type float, string given, called in /in/GrMs9 on line 10 and defined in /in/GrMs9:3 Stack trace: #0 /in/GrMs9(10): a('banana') #1 {main} thrown in /in/GrMs9 on line 3
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
float(1) float(1.1) float(12) Fatal error: Uncaught TypeError: Argument 1 passed to a() must be of the type float, string given, called in /in/GrMs9 on line 10 and defined in /in/GrMs9:3 Stack trace: #0 /in/GrMs9(10): a('banana') #1 {main} thrown in /in/GrMs9 on line 3
Process exited with code 255.

preferences:
102.57 ms | 1653 KiB | 4 Q