3v4l.org

run code in 300+ PHP versions simultaneously
<?php function check(float $value){ $value < 0.001 or $value > 1000.0 and throw new \InvalidArgumentException( 'FairnessWeight must be in the range [0.001, 1000].', ); } $values = [0.0, 1000.0, -1.0, 1010.0]; foreach($values as $v) { echo "Checking value: {$v}:\t"; try { check($v); echo "all good. \n"; } catch (\Throwable $e) { echo "failed! {$e->getMessage()}\n"; } }

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.30.0250.01217.46
8.5.20.0350.00816.67
8.5.10.0330.00716.68
8.5.00.0320.01016.24
8.4.180.0370.00719.44
8.4.170.0320.01019.62
8.4.160.0330.00719.73
8.4.150.0240.00919.73
8.4.140.0230.00817.65
8.4.130.0240.00817.41
8.4.120.0240.00519.75
8.4.110.0130.01417.98
8.4.100.0170.00917.81
8.4.90.0190.00817.89
8.4.80.0180.01017.70
8.4.70.0220.00518.00
8.4.60.0220.00517.90
8.4.50.0220.00617.86
8.4.40.0180.01017.68
8.4.30.0200.00817.77
8.4.20.0170.01117.72
8.4.10.0210.00917.76
8.3.300.0190.00718.20
8.3.290.0200.00818.29
8.3.280.0340.00918.22
8.3.270.0330.01016.75
8.3.260.0330.00816.61
8.3.250.0340.00816.37
8.3.240.0350.00718.60
8.3.230.0330.01016.40
8.3.220.0350.01016.67
8.3.210.0310.01116.61
8.3.200.0340.01116.73
8.3.190.0360.01016.68
8.3.180.0210.01016.71
8.3.170.0380.01518.36
8.3.160.0350.00816.29
8.3.150.0350.01016.55
8.3.140.0350.01216.66
8.3.130.0350.00716.61
8.3.120.0230.00916.61
8.3.110.0260.00918.43
8.3.100.0280.01118.30
8.3.90.0330.00816.68
8.3.80.0370.00816.74
8.3.70.0320.01218.64
8.3.60.0160.01018.61
8.3.50.0170.01216.55
8.3.40.0230.00817.92
8.3.30.0200.00719.53
8.3.20.0180.00819.62
8.3.10.0190.00917.82
8.3.00.0190.01119.76

preferences:
46.53 ms | 721 KiB | 5 Q