3v4l.org

run code in 300+ PHP versions simultaneously
<?php function filterLabel($label) { $filtered = key(array(trim($label) => 1)); if ($filtered === false) { throw new UnexpectedValueException('Unable to filter %s', var_export($label, true)); } return $filtered; } $data = array("foo", "0foo", 0, "0", "00", 1, NULL, FALSE, new SimpleXMLElement('<root />')); foreach ($data as $index => $label) { printf("==== %d ====\n", $index); var_dump($label, filterLabel($label)); }

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.0110.00418.55
8.3.50.0110.00723.02
8.3.40.0040.01519.04
8.3.30.0040.01119.22
8.3.20.0070.00020.46
8.3.10.0080.00023.78
8.3.00.0090.00019.45
8.2.180.0120.00325.92
8.2.170.0080.00819.29
8.2.160.0090.00620.63
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0110.00026.16
8.2.120.0040.00421.32
8.2.110.0040.00420.47
8.2.100.0070.00418.28
8.2.90.0080.00019.40
8.2.80.0040.00417.97
8.2.70.0030.00617.75
8.2.60.0050.00318.17
8.2.50.0060.00318.07
8.2.40.0020.00518.47
8.2.30.0030.00518.21
8.2.20.0040.00417.98
8.2.10.0040.00418.16
8.2.00.0040.00417.90
8.1.280.0070.01525.92
8.1.270.0080.00024.17
8.1.260.0050.00226.35
8.1.250.0080.00028.09
8.1.240.0030.00624.17
8.1.230.0080.00419.34
8.1.220.0030.00518.02
8.1.210.0040.00418.77
8.1.200.0040.00417.60
8.1.190.0080.00417.25
8.1.180.0000.00818.10
8.1.170.0030.00618.77
8.1.160.0070.00022.10
8.1.150.0070.00019.19
8.1.140.0000.00717.56
8.1.130.0040.00417.89
8.1.120.0000.00717.59
8.1.110.0000.00717.54
8.1.100.0080.00017.66
8.1.90.0040.00417.55
8.1.80.0000.00717.58
8.1.70.0030.00517.59
8.1.60.0040.00417.66
8.1.50.0040.00417.61
8.1.40.0000.00917.57
8.1.30.0000.00817.68
8.1.20.0070.00017.80
8.1.10.0040.00417.84
8.1.00.0040.00417.56
8.0.300.0020.00518.77
8.0.290.0030.00516.86
8.0.280.0070.00018.52
8.0.270.0000.00817.36
8.0.260.0000.00717.36
8.0.250.0030.00317.20
8.0.240.0030.00617.13
8.0.230.0070.00017.13
8.0.220.0000.00717.14
8.0.210.0030.00316.98
8.0.200.0000.00817.08
8.0.190.0000.00817.16
8.0.180.0040.00417.01
8.0.170.0000.00817.09
8.0.160.0040.00417.00
8.0.150.0070.00017.09
8.0.140.0040.00416.96
8.0.130.0060.00013.51
8.0.120.0030.00517.08
8.0.110.0050.00217.08
8.0.100.0020.00516.88
8.0.90.0040.00417.13
8.0.80.0030.01616.94
8.0.70.0040.00417.09
8.0.60.0040.00417.12
8.0.50.0040.00417.04
8.0.30.0060.01417.35
8.0.20.0080.01317.41
8.0.10.0000.00717.14
8.0.00.0110.00816.84
7.4.330.0000.00715.00
7.4.320.0000.00616.77
7.4.300.0000.00716.71
7.4.290.0030.00316.64
7.4.280.0070.00116.83
7.4.270.0030.00316.71
7.4.260.0030.00316.70
7.4.250.0030.00516.64
7.4.240.0030.00516.75
7.4.230.0030.00316.61
7.4.220.0130.00416.86
7.4.210.0040.01116.83
7.4.200.0030.00316.85
7.4.160.0070.01016.73
7.4.150.0060.01317.40
7.4.140.0110.00617.86
7.4.130.0080.00816.76
7.4.120.0110.00916.80
7.4.110.0070.01816.64
7.4.100.0080.01116.47
7.4.90.0050.01316.65
7.4.80.0090.00919.39
7.4.70.0030.01416.80
7.4.60.0060.01216.64
7.4.50.0050.00316.52
7.4.40.0090.00616.62
7.4.30.0030.01816.59
7.4.00.0060.00714.91
7.3.330.0030.00313.30
7.3.320.0030.00313.52
7.3.310.0000.00816.45
7.3.300.0070.00016.59
7.3.290.0060.00916.54
7.3.280.0090.00616.55
7.3.270.0160.00817.40
7.3.260.0100.01016.61
7.3.250.0100.00716.59
7.3.240.0070.01116.82
7.3.230.0120.00616.50
7.3.210.0110.01116.55
7.3.200.0090.01219.39
7.3.190.0070.01616.57
7.3.180.0140.00316.63
7.3.170.0060.01016.59
7.3.160.0110.00616.67
7.3.120.0040.01414.88
7.3.110.0070.01114.89
7.3.100.0080.00314.87
7.3.90.0000.01714.84
7.3.80.0030.00615.00
7.3.70.0070.01015.03
7.3.60.0030.01314.82
7.3.50.0070.01114.97
7.3.40.0060.00915.09
7.3.30.0040.00414.74
7.3.20.0040.01116.78
7.3.10.0060.00616.74
7.3.00.0030.00616.62
7.2.330.0120.01216.70
7.2.320.0090.01217.02
7.2.310.0060.01116.77
7.2.300.0060.01216.66
7.2.290.0110.00616.79
7.2.250.0130.00715.19
7.2.240.0150.00414.93
7.2.230.0080.01115.21
7.2.220.0030.00615.39
7.2.210.0070.01115.03
7.2.200.0110.00315.30
7.2.190.0100.00715.14
7.2.180.0000.01715.29
7.2.170.0060.00615.21
7.2.00.0110.00719.73
7.1.330.0080.00815.86
7.1.320.0030.01315.90
7.1.310.0040.01415.89
7.1.300.0030.01215.80
7.1.290.0060.00615.80
7.1.280.0030.01015.85
7.1.270.0060.00615.93
7.1.260.0110.00415.79
7.1.100.0060.00918.29
7.1.70.0040.00417.44
7.1.60.0090.00919.46
7.1.50.0070.01417.19
7.1.00.0070.07322.55
7.0.200.0000.00816.71
7.0.140.0030.07022.11
7.0.60.0100.07720.08
7.0.50.0070.04717.91
7.0.40.0100.06020.39
7.0.30.0330.07720.20
7.0.20.0270.08020.30
7.0.10.0130.05720.20
7.0.00.0030.04320.39
5.6.280.0100.06721.16
5.6.210.0070.06020.58
5.6.200.0100.05318.41
5.6.190.0100.08020.50
5.6.180.0270.08020.48
5.6.170.0200.03720.67
5.6.160.0130.06720.57
5.6.150.0130.03318.22
5.6.140.0070.08018.32
5.6.130.0030.07718.37
5.6.120.0000.08321.19
5.6.110.0070.04321.03
5.6.100.0130.08021.00
5.6.90.0070.07021.16
5.6.80.0070.06020.59
5.6.70.4430.03720.50
5.5.350.0030.04020.40
5.5.340.0100.04718.05
5.5.330.0070.04720.38
5.5.320.0000.09020.48
5.5.310.0300.04320.49
5.5.300.0130.07318.20
5.5.290.0100.04718.10
5.5.280.0070.04021.02
5.5.270.0070.07020.77
5.5.260.0030.09321.00
5.5.250.0070.08720.73
5.5.240.0300.06320.23
5.4.450.0330.04719.38
5.4.440.0400.04019.59
5.4.430.0270.05019.45
5.4.420.0200.04719.37
5.4.410.0130.03019.48
5.4.400.0230.04319.33
5.4.390.0230.04019.24
5.4.380.0300.06018.91
5.4.370.0330.05318.52
5.4.360.0300.05018.83
5.4.350.0370.05718.91
5.4.340.0370.05318.83
5.4.320.0050.03612.61
5.4.310.0060.04412.61
5.4.300.0070.03912.61
5.4.290.0070.04612.61
5.4.280.0100.03712.50
5.4.270.0040.04812.51
5.4.260.0080.04112.50
5.4.250.0040.04412.51
5.4.240.0060.03612.50
5.4.230.0060.05012.50
5.4.220.0060.03812.50
5.4.210.0060.03912.50
5.4.200.0070.04512.50
5.4.190.0060.04612.49
5.4.180.0060.03612.50
5.4.170.0110.03312.51
5.4.160.0030.04712.50
5.4.150.0050.03612.50
5.4.140.0090.03512.18
5.4.130.0100.03812.17
5.4.120.0060.04012.13
5.4.110.0090.04412.12
5.4.100.0040.03712.13
5.4.90.0050.03912.12
5.4.80.0090.03412.12
5.4.70.0090.03612.12
5.4.60.0090.03412.12
5.4.50.0060.04112.11
5.4.40.0050.03712.11
5.4.30.0070.03512.09
5.4.20.0120.03212.10
5.4.10.0080.03612.10
5.4.00.0070.03411.59
5.3.290.0070.03812.87
5.3.280.0050.03712.80
5.3.270.0080.03612.81
5.3.260.0090.04312.80
5.3.250.0070.03612.81
5.3.240.0060.03912.81
5.3.230.0080.03712.80
5.3.220.0060.03812.77
5.3.210.0020.04312.77
5.3.200.0040.03912.77
5.3.190.0070.03612.77
5.3.180.0070.03612.77
5.3.170.0070.03612.77
5.3.160.0080.03512.77
5.3.150.0080.03512.76
5.3.140.0080.03912.76
5.3.130.0060.04012.75
5.3.120.0060.04212.75
5.3.110.0050.04212.75
5.3.100.0090.04312.25
5.3.90.0090.04112.22
5.3.80.0030.03812.21
5.3.70.0050.04412.21
5.3.60.0070.03312.20
5.3.50.0040.03712.14
5.3.40.0080.04412.14
5.3.30.0040.03712.11
5.3.20.0080.03211.88
5.3.10.0050.03411.85
5.3.00.0060.03511.83
5.2.170.0040.0319.33
5.2.160.0070.0329.34
5.2.150.0040.0309.34
5.2.140.0070.0269.33
5.2.130.0030.0299.30
5.2.120.0070.0269.30
5.2.110.0050.0289.30
5.2.100.0080.0319.30
5.2.90.0030.0309.30
5.2.80.0060.0299.30
5.2.70.0040.0309.30
5.2.60.0050.0359.25
5.2.50.0060.0299.22
5.2.40.0040.0329.19
5.2.30.0020.0319.16
5.2.20.0050.0299.16
5.2.10.0070.0249.07
5.2.00.0040.0288.93
5.1.60.0070.0218.21
5.1.50.0020.0268.21
5.1.40.0020.0258.19
5.1.30.0030.0268.54
5.1.20.0080.0278.55
5.1.10.0050.0258.28
5.1.00.0050.0258.28
5.0.50.0040.0196.64
5.0.40.0040.0196.50
5.0.30.0030.0306.31
5.0.20.0050.0186.28
5.0.10.0050.0206.26
5.0.00.0050.0286.25
4.4.90.0030.0214.78
4.4.80.0040.0204.76
4.4.70.0030.0144.75
4.4.60.0040.0194.75
4.4.50.0030.0194.77
4.4.40.0050.0354.71
4.4.30.0020.0164.76
4.4.20.0040.0144.84
4.4.10.0010.0174.85
4.4.00.0010.0274.76
4.3.110.0020.0164.67
4.3.100.0030.0134.66
4.3.90.0050.0164.63
4.3.80.0010.0254.59
4.3.70.0020.0144.63
4.3.60.0040.0134.63
4.3.50.0020.0154.63
4.3.40.0050.0314.54
4.3.30.0020.0243.29
4.3.20.0030.0213.27
4.3.10.0010.0173.24
4.3.00.0030.01718.23

preferences:
44.07 ms | 401 KiB | 5 Q