3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = array(array(0, .1), array(1, 'foo'), array(.24, -.25), array(3, 3), array('foo', 'bar'), array(-0, 0.1), array(90, -90), array(0, 0), array(1, 1)); foreach ($tests as $test) { echo "Raw: {$test[0]} -vs- {$test[1]} , "; $nums = array((float)$test[0],(float)$test[1]); // force input values to float values echo "FloatVals: {$nums[0]} -vs- {$nums[1]} , "; $nums = array_filter($nums, function($v){ return $v > 0;}); // check if greater than 0 if (empty($nums)) { $price = 'error'; //use die(), but I won't for demonstration } else { $price = min($nums); // declare lowest qualifying price } echo "Output: $price\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.4.130.0070.00217.78
8.4.120.0130.00720.41
8.4.110.0040.00519.03
8.4.100.0130.00817.74
8.4.90.0120.00918.77
8.4.80.0120.00917.68
8.4.70.0130.00717.91
8.4.60.0100.01120.30
8.4.50.0140.00920.51
8.4.40.0070.01317.82
8.4.30.0160.00317.68
8.4.20.0130.00719.65
8.4.10.0050.00517.63
8.3.250.0100.00918.80
8.3.240.0070.00820.70
8.3.230.0130.00516.44
8.3.220.0050.00417.22
8.3.210.0120.00516.59
8.3.200.0050.00416.39
8.3.190.0060.00217.00
8.3.180.0050.00416.46
8.3.170.0000.01718.84
8.3.160.0090.00918.27
8.3.150.0110.00720.91
8.3.140.0120.00920.25
8.3.130.0150.00018.41
8.3.120.0130.00618.90
8.3.110.0040.00420.94
8.3.100.0130.00316.55
8.3.90.0040.00426.77
8.3.80.0030.00618.43
8.3.70.0100.00716.58
8.3.60.0120.00318.43
8.3.50.0050.00916.41
8.3.40.0120.00318.61
8.3.30.0170.00718.60
8.3.20.0080.00021.85
8.3.10.0030.00623.66
8.3.00.0040.00419.68
8.2.290.0100.00920.38
8.2.280.0080.00722.23
8.2.270.0110.00417.05
8.2.260.0060.01320.19
8.2.250.0030.00616.86
8.2.240.0130.00618.71
8.2.230.0180.00322.58
8.2.220.0030.00624.06
8.2.210.0060.01326.77
8.2.200.0060.00316.50
8.2.190.0110.00418.41
8.2.180.0030.01425.92
8.2.170.0060.00919.08
8.2.160.0040.01122.96
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0070.00020.68
8.2.110.0030.00722.11
8.2.100.0070.00717.84
8.2.90.0000.00917.91
8.2.80.0040.00419.29
8.2.70.0030.00617.75
8.2.60.0040.00418.16
8.2.50.0000.00720.44
8.2.40.0030.00618.05
8.2.30.0060.00319.31
8.2.20.0000.00718.13
8.2.10.0000.00817.80
8.2.00.0000.00818.13
8.1.330.0110.00722.22
8.1.320.0110.00816.15
8.1.310.0060.01216.88
8.1.300.0100.01019.61
8.1.290.0000.00830.84
8.1.280.0070.01125.92
8.1.270.0030.00523.85
8.1.260.0030.00526.35
8.1.250.0050.00228.09
8.1.240.0080.00022.08
8.1.230.0070.00721.04
8.1.220.0040.00417.79
8.1.210.0090.00018.77
8.1.200.0030.00617.35
8.1.190.0030.00517.23
8.1.180.0050.00518.10
8.1.170.0040.00417.62
8.1.160.0080.00018.91
8.1.150.0000.00818.66
8.1.140.0000.00817.65
8.1.130.0040.00417.39
8.1.120.0000.00717.38
8.1.110.0000.00817.39
8.1.100.0000.00717.35
8.1.90.0070.00317.48
8.1.80.0000.00717.36
8.1.70.0070.00017.38
8.1.60.0080.00017.52
8.1.50.0030.00617.41
8.1.40.0000.00817.55
8.1.30.0070.00317.62
8.1.20.0000.00717.48
8.1.10.0040.00417.50
8.1.00.0080.00017.48
8.0.300.0050.00320.13
8.0.290.0040.00416.75
8.0.280.0040.00418.38
8.0.270.0030.00317.19
8.0.260.0060.00016.74
8.0.250.0030.00316.91
8.0.240.0030.00516.97
8.0.230.0000.00816.86
8.0.220.0000.00716.91
8.0.210.0030.00316.87
8.0.200.0000.00716.94
8.0.190.0000.00716.97
8.0.180.0050.00316.83
8.0.170.0030.00616.90
8.0.160.0000.00716.95
8.0.150.0040.00416.83
8.0.140.0000.00716.75
8.0.130.0030.00313.36
8.0.120.0050.00316.77
8.0.110.0000.00716.96
8.0.100.0000.00716.96
8.0.90.0080.00016.73
8.0.80.0080.00816.95
8.0.70.0040.00416.88
8.0.60.0070.00017.02
8.0.50.0000.00716.90
8.0.30.0130.00517.20
8.0.20.0120.00717.40
8.0.10.0040.00416.88
8.0.00.0080.01016.71
7.4.330.0000.00515.55
7.4.320.0030.00316.59
7.4.300.0030.00316.58
7.4.290.0000.00716.61
7.4.280.0070.00416.52
7.4.270.0030.00316.55
7.4.260.0070.00316.52
7.4.250.0020.00516.62
7.4.240.0030.00316.62
7.4.230.0030.00316.53
7.4.220.0000.00816.64
7.4.210.0100.00516.63
7.4.200.0000.00716.71
7.4.160.0120.00616.50
7.4.140.0140.00517.86
7.4.130.0100.00616.39
7.4.120.0070.01216.52
7.4.110.0090.00916.62
7.4.100.0100.00716.58
7.4.90.0110.00616.66
7.4.80.0080.01619.39
7.4.70.0000.01816.55
7.4.60.0030.01316.37
7.4.50.0090.00316.53
7.4.40.0100.00716.41
7.4.10.0030.01514.77
7.4.00.0050.01115.08
7.3.330.0060.00013.37
7.3.320.0060.00013.36
7.3.310.0030.00516.26
7.3.300.0030.00316.37
7.3.290.0000.00716.37
7.3.280.0070.01316.41
7.3.260.0100.01016.41
7.3.240.0090.01016.35
7.3.230.0060.01216.38
7.3.210.0090.01116.42
7.3.200.0060.01116.37
7.3.190.0030.01316.37
7.3.180.0060.01116.67
7.3.170.0110.00616.29
7.3.160.0030.01816.52
7.3.130.0030.01315.04
7.3.120.0040.00814.79
7.3.110.0100.01014.74
7.3.100.0070.01114.63
7.3.90.0130.00614.77
7.3.80.0100.00714.82
7.3.70.0030.01314.61
7.3.60.0060.00614.82
7.3.50.0030.01315.02
7.3.40.0030.00614.59
7.3.30.0060.00314.64
7.3.20.0100.00316.63
7.3.10.0080.00516.69
7.3.00.0050.00816.78
7.2.330.0120.00816.75
7.2.320.0040.01216.64
7.2.310.0040.01316.76
7.2.300.0120.00816.39
7.2.290.0070.01616.88
7.2.260.0060.01215.29
7.2.250.0120.00915.16
7.2.240.0100.00714.72
7.2.230.0070.01015.26
7.2.220.0130.00714.95
7.2.210.0040.01115.14
7.2.200.0130.00314.99
7.2.190.0100.00315.00
7.2.180.0040.01115.05
7.2.170.0070.00315.11
7.2.160.0030.01215.23
7.2.150.0090.00616.89
7.2.140.0030.01016.73
7.2.130.0090.00616.97
7.2.120.0080.00616.70
7.2.110.0070.00716.95
7.2.100.0060.00816.89
7.2.90.0090.00516.98
7.2.80.0090.00216.70
7.2.70.0060.00916.94
7.2.60.0030.01016.99
7.2.50.0090.00616.93
7.2.40.0040.00616.75
7.2.30.0060.01217.98
7.2.20.0060.01417.80
7.2.10.0070.00917.81
7.2.00.0100.01017.83
7.1.330.0080.00415.86
7.1.320.0030.00915.54
7.1.310.0070.01115.71
7.1.300.0030.00915.91
7.1.290.0100.00615.60
7.1.280.0090.00615.61
7.1.270.0000.01115.97
7.1.260.0030.01015.61
7.1.250.0030.00915.81
7.1.240.0030.01015.83
7.1.230.0090.00615.86
7.1.220.0070.00715.70
7.1.210.0110.00315.82
7.1.200.0110.00215.79
7.1.190.0040.00715.63
7.1.180.0040.00715.55
7.1.170.0030.01415.90
7.1.160.0090.00015.80
7.1.150.0060.01017.11
7.1.140.0070.00817.32
7.1.130.0050.01017.30
7.1.120.0080.01017.29
7.1.110.0090.00916.91
7.1.100.0110.00416.94
7.1.90.0090.00917.04
7.1.80.0080.01016.82
7.1.70.0060.01016.59
7.1.60.0160.01325.43
7.1.50.0140.01125.37
7.1.40.0190.01625.15
7.1.30.0170.01025.21
7.1.20.0170.01525.05
7.1.10.0060.01416.04
7.1.00.0070.00916.20
7.0.330.0090.00615.25
7.0.320.0070.00715.50
7.0.310.0090.00315.57
7.0.300.0060.00615.54
7.0.290.0080.00415.45
7.0.280.0120.00015.38
7.0.270.0100.00615.46
7.0.260.0000.01315.36
7.0.250.0040.00415.61
7.0.240.0030.00915.22
7.0.230.0030.01315.63
7.0.220.0040.01115.25
7.0.210.0060.00915.24
7.0.200.0070.00715.39
7.0.190.0000.01115.46
7.0.180.0060.00915.41
7.0.170.0150.00015.23
7.0.160.0060.00915.53
7.0.150.0090.00615.44
7.0.140.0060.00615.42
7.0.130.0060.00615.55
7.0.120.0110.00315.58
7.0.110.0060.00315.24
7.0.100.0100.00315.59
7.0.90.0130.00315.54
7.0.80.0070.00715.48
7.0.70.0110.00415.43
7.0.60.0030.00915.41
7.0.50.0000.00915.39
7.0.40.0030.01313.48
7.0.30.0030.00913.52
7.0.20.0030.00613.47
7.0.10.0100.00713.55
7.0.00.0030.01013.58
5.6.400.0040.01114.65
5.6.390.0060.00314.67
5.6.380.0120.00314.48
5.6.370.0070.00714.78
5.6.360.0000.01114.47
5.6.350.0070.00714.29
5.6.340.0000.01014.43
5.6.330.0090.00614.41
5.6.320.0070.00714.75
5.6.310.0070.01014.43
5.6.300.0130.00014.03
5.6.290.0040.00714.78
5.6.280.0150.00014.21
5.6.270.0030.01014.78
5.6.260.0000.01514.19
5.6.250.0030.01314.48
5.6.240.0060.00914.35
5.6.230.0110.00314.32
5.6.220.0000.01514.20
5.6.210.0090.00314.31
5.6.200.0030.01014.48
5.6.190.0060.00314.43
5.6.180.0060.01214.64
5.6.170.0100.00614.41
5.6.160.0070.00714.10
5.6.150.0000.01414.50
5.6.140.0030.00714.23
5.6.130.0030.00614.35
5.6.120.0000.01314.16
5.6.110.0000.01314.29
5.6.100.0110.00414.38
5.6.90.0060.00914.55
5.6.80.0100.01014.32
5.6.70.0060.01314.14
5.6.60.0030.01314.05
5.6.50.0090.00914.35
5.6.40.0030.00614.45
5.6.30.0070.00414.08
5.6.20.0090.00614.20
5.6.10.0090.00014.36
5.6.00.0000.01314.27

preferences:
27.36 ms | 403 KiB | 5 Q