3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parseIntOrException($val) { $int = (int)$val; if ((string)$int !== (string)$val) { return FALSE; } return $int; } $result = array(); foreach (array(-2.5, -8,1, '2', '3.0', 4.0, 5) as $x) { $result[var_export($x, TRUE)] = var_export(parseIntOrException($x), TRUE); } print_r($result);

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.3.60.0140.00316.38
8.3.50.0140.00521.19
8.3.40.0040.01118.67
8.3.30.0140.00018.57
8.3.20.0070.00020.21
8.3.10.0040.00423.61
8.3.00.0030.00519.56
8.2.180.0140.00718.41
8.2.170.0110.00422.96
8.2.160.0100.00320.11
8.2.150.0040.00425.66
8.2.140.0150.00324.66
8.2.130.0000.00726.16
8.2.120.0040.00417.63
8.2.110.0000.00919.21
8.2.100.0080.00417.63
8.2.90.0090.00019.21
8.2.80.0030.00517.97
8.2.70.0060.00317.63
8.2.60.0000.00817.93
8.2.50.0030.00618.07
8.2.40.0000.00719.39
8.2.30.0080.00019.95
8.2.20.0040.00417.63
8.2.10.0040.00418.14
8.2.00.0000.00718.14
8.1.280.0140.00025.92
8.1.270.0040.01220.29
8.1.260.0110.00426.35
8.1.250.0050.00228.09
8.1.240.0030.00620.93
8.1.230.0100.00017.42
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0040.00417.36
8.1.190.0040.00417.00
8.1.180.0000.00718.10
8.1.170.0040.00418.51
8.1.160.0040.00422.00
8.1.150.0030.00518.74
8.1.140.0030.00517.32
8.1.130.0030.00317.54
8.1.120.0000.00717.30
8.1.110.0000.00717.45
8.1.100.0000.00717.39
8.1.90.0040.00417.34
8.1.80.0080.00017.31
8.1.70.0000.00717.45
8.1.60.0080.00017.61
8.1.50.0040.00417.46
8.1.40.0000.00917.44
8.1.30.0050.00317.70
8.1.20.0000.00817.59
8.1.10.0040.00417.48
8.1.00.0000.00717.52
8.0.300.0050.00318.77
8.0.290.0050.00216.75
8.0.280.0080.00018.27
8.0.270.0050.00317.16
8.0.260.0030.00317.11
8.0.250.0040.00416.81
8.0.240.0050.00316.97
8.0.230.0030.00316.96
8.0.220.0050.00216.76
8.0.210.0070.00016.71
8.0.200.0000.00616.82
8.0.190.0040.00416.79
8.0.180.0000.00816.85
8.0.170.0030.00616.77
8.0.160.0040.00416.87
8.0.150.0030.00316.71
8.0.140.0030.00316.80
8.0.130.0060.00313.22
8.0.120.0040.00416.80
8.0.110.0040.00416.84
8.0.100.0040.00416.82
8.0.90.0060.00316.88
8.0.80.0100.01016.76
8.0.70.0000.00816.70
8.0.60.0070.00016.63
8.0.50.0050.00216.80
8.0.30.0150.00617.22
8.0.20.0090.02017.40
8.0.10.0040.00316.77
8.0.00.0090.00816.77
7.4.330.0030.00315.08
7.4.320.0000.00616.43
7.4.300.0060.00016.61
7.4.290.0000.00716.61
7.4.280.0000.00716.52
7.4.270.0030.00316.59
7.4.260.0040.00416.52
7.4.250.0040.00416.43
7.4.240.0040.00316.61
7.4.230.0000.00716.35
7.4.220.0090.00916.60
7.4.210.0070.01316.52
7.4.200.0000.00716.45
7.4.160.0130.00316.42
7.4.150.0290.00017.40
7.4.140.0130.00617.86
7.4.130.0100.01016.57
7.4.120.0080.00816.38
7.4.110.0130.01316.71
7.4.100.0080.01316.53
7.4.90.0170.00316.45
7.4.80.0070.01019.39
7.4.70.0110.00616.50
7.4.60.0120.00316.48
7.4.50.0030.00616.57
7.4.40.0110.00616.39
7.4.30.0110.00816.62
7.4.00.0070.00714.88
7.3.330.0040.00213.45
7.3.320.0000.00613.36
7.3.310.0040.00416.23
7.3.300.0040.00416.26
7.3.290.0070.01016.34
7.3.280.0100.00516.37
7.3.270.0070.01017.40
7.3.260.0160.00316.54
7.3.250.0070.01116.40
7.3.240.0070.01016.30
7.3.230.0090.00916.39
7.3.210.0130.00316.46
7.3.200.0060.01216.58
7.3.190.0140.00716.61
7.3.180.0070.01016.54
7.3.170.0110.00916.43
7.3.160.0030.01716.48
7.3.120.0070.01014.88
7.3.110.0060.01014.79
7.3.100.0100.00714.79
7.3.90.0000.00914.64
7.3.80.0000.01414.65
7.3.70.0080.00615.00
7.3.60.0130.00314.82
7.3.50.0090.00314.91
7.3.40.0030.01114.86
7.3.30.0030.00614.78
7.3.20.0040.00716.41
7.3.10.0030.00816.70
7.3.00.0060.00916.75
7.2.330.0130.00316.74
7.2.320.0130.00716.81
7.2.310.0160.00016.56
7.2.300.0130.00316.71
7.2.290.0090.00916.38
7.2.250.0090.00614.96
7.2.240.0000.01815.29
7.2.230.0090.00614.89
7.2.220.0160.00314.63
7.2.210.0030.01015.20
7.2.200.0030.00614.88
7.2.190.0030.00714.65
7.2.180.0080.00814.73
7.2.170.0090.00615.09
7.2.60.0040.00817.00
7.2.00.0060.00619.36
7.1.330.0110.00315.75
7.1.320.0040.01115.39
7.1.310.0040.01115.88
7.1.300.0030.00715.83
7.1.290.0060.00915.63
7.1.280.0030.00615.60
7.1.270.0030.00515.48
7.1.260.0000.01215.76
7.1.200.0000.01015.48
7.1.100.0070.00717.75
7.1.70.0030.00317.21
7.1.60.0140.01020.03
7.1.50.0140.01016.61
7.1.00.0070.07322.37
7.0.200.0040.00716.64
7.0.60.0030.07719.89
7.0.50.0000.04317.84
7.0.40.0100.08320.22
7.0.30.0100.05720.16
7.0.20.0230.06720.07
7.0.10.0030.08720.19
7.0.00.0070.04020.22
5.6.210.0200.06720.55
5.6.200.0070.07318.16
5.6.190.0100.03320.55
5.6.180.0370.07320.38
5.6.170.0130.04320.45
5.6.160.0200.03320.51
5.6.150.0030.08318.16
5.6.140.0030.05718.15
5.6.130.0000.06018.21
5.6.120.0030.04021.13
5.6.110.0130.07720.89
5.6.100.0000.04721.12
5.6.90.0100.06720.98
5.6.80.0000.04020.39
5.5.350.0070.08720.36
5.5.340.0100.03718.02
5.5.330.0070.04020.47
5.5.320.1270.04720.51
5.5.310.0270.05020.34
5.5.300.0070.08017.97
5.5.290.0070.08318.04
5.5.280.0000.04720.88
5.5.270.0130.06320.96
5.5.260.0100.08020.79
5.5.250.0130.07720.57
5.5.240.0030.08320.19
5.4.450.0300.05719.29
5.4.440.0330.05019.59
5.4.430.0330.05319.61
5.4.420.0330.05019.28
5.4.410.0330.05019.25
5.4.400.0270.05319.23
5.4.390.0300.05318.84
5.4.380.0300.05319.03
5.4.370.0300.05319.00
5.4.360.0430.04019.07
5.4.350.0330.05319.39
5.4.340.0270.06019.23
5.4.320.0430.05019.00
5.4.310.0300.05319.06
5.4.300.0400.04719.25
5.4.290.0370.05019.11
5.4.280.0330.05319.12
5.4.270.0400.04719.28
5.4.260.0300.05319.36
5.4.250.0470.04719.27
5.4.240.0470.04319.04
5.4.230.0270.05719.21
5.4.220.0300.05719.27
5.4.210.0300.05719.25
5.4.200.0400.06019.13
5.4.190.0270.05719.21
5.4.180.0400.04719.35
5.4.170.0270.06319.07
5.4.160.0500.04318.94
5.4.150.0530.06319.23
5.4.140.0630.05016.34
5.4.130.0430.05716.58
5.4.120.0400.04716.47
5.4.110.0370.05716.47
5.4.100.0330.05316.62
5.4.90.0370.04716.50
5.4.80.0270.05316.65
5.4.70.0330.03716.62
5.4.60.0330.04316.31
5.4.50.0000.05016.51
5.4.40.0170.04016.43
5.4.30.0030.03716.42
5.4.20.0370.06316.57
5.4.10.0230.04016.52

preferences:
45.71 ms | 401 KiB | 5 Q