3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); class Test { public static function valid(?float $value): bool { if ($value !== null && !is_float($value)) throw new InvalidArgumentException('Not valid'); return true; } } var_dump(Test::valid('1.2')); // "valid" because of implicit typecast, which can disabled with declare strict_types var_dump(Test::valid('not a number')); // triggers TypeError, NOT InvalidArgumentException

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.5.90.0100.00718.09
8.5.80.0090.00916.99
8.5.70.0060.00217.09
8.5.60.0110.00716.96
8.5.50.0030.00516.97
8.5.30.0090.00819.85
8.5.20.0090.00720.16
8.5.10.0070.00316.85
8.5.00.0160.01220.00
8.4.230.0060.00419.65
8.4.220.0140.00719.64
8.4.210.0130.00919.75
8.4.180.0120.01019.63
8.4.170.0130.00823.94
8.4.160.0100.01123.91
8.4.150.0070.00616.95
8.4.140.0130.00817.95
8.4.130.0190.00517.61
8.4.120.0120.00822.43
8.4.110.0100.01022.14
8.4.100.0040.00617.90
8.4.90.0070.00217.89
8.4.80.0080.00818.00
8.4.70.0420.01018.14
8.4.60.0380.00818.14
8.4.50.0190.00418.14
8.4.40.0210.00518.14
8.4.30.0160.00818.14
8.4.20.0400.01218.14
8.4.10.0400.01218.14
8.3.320.0130.00718.39
8.3.310.0110.00918.45
8.3.300.0100.01020.84
8.3.290.0130.00720.80
8.3.280.0110.00918.48
8.3.270.0090.01116.42
8.3.260.0130.00616.59
8.3.250.0090.01018.69
8.3.240.0100.01017.20
8.3.230.0130.00616.51
8.3.220.0050.00316.60
8.3.210.0270.00418.14
8.3.200.0200.00618.14
8.3.190.0450.00518.14
8.3.180.0400.00618.14
8.3.170.0420.01118.14
8.3.160.0350.00318.14
8.3.150.0340.00418.14
8.3.140.0450.00818.14
8.3.130.0320.00618.14
8.3.120.0380.00718.14
8.3.110.0350.01018.14
8.3.100.0430.00818.14
8.3.90.0450.00418.14
8.3.80.0400.01118.14
8.3.70.0370.00718.14
8.3.60.0190.00518.14
8.3.50.0220.00518.14
8.3.40.0200.00418.14
8.3.30.0320.00818.14
8.3.20.0240.00518.14
8.3.10.0110.00718.14
8.3.00.0200.00918.14
8.2.320.0110.00819.92
8.2.310.0080.01118.08
8.2.300.0070.01218.23
8.2.290.0050.00320.19
8.2.280.0230.00318.14
8.2.270.0280.00318.14
8.2.260.0150.00418.14
8.2.250.0140.00718.14
8.2.240.0160.00318.14
8.2.230.0140.00618.14
8.2.220.0150.00518.14
8.2.210.0150.00418.14
8.2.200.0180.00718.14
8.2.190.0340.00718.14
8.2.180.0250.00318.14
8.2.170.0270.00318.14
8.2.160.0280.00518.14
8.2.150.0200.00518.14
8.2.140.0270.00718.14
8.2.130.0210.00318.14
8.2.120.0180.00218.14
8.2.110.0170.00318.14
8.2.100.0240.00618.14
8.2.90.0300.00518.14
8.2.80.0350.00918.14
8.2.70.0560.01118.14
8.2.60.0370.00918.14
8.2.50.0480.00418.14
8.2.40.0260.00418.14
8.2.30.0210.00618.14
8.2.20.0230.00318.14
8.2.10.0200.00118.14
8.2.00.0310.01018.14
8.1.340.0120.01121.74

preferences:
57.65 ms | 911 KiB | 5 Q