3v4l.org

run code in 300+ PHP versions simultaneously
<?php $postcodes = array( 'NE', 'NG', 'PE' ); function matches($needle, $postcodes) { foreach ($postcodes as $postcode) { if ($postcode === substr($needle, 0, strlen($postcode))) { return true; } } return false; } foreach (array('NE1', 'RG', 'PE') as $needle) { printf( "%s %s\n", $needle, matches($needle, $postcodes) ? 'matches' : 'does not match' ); } /* NE1 matches RG does not match PE matches */

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.00716.50
8.3.50.0120.00821.94
8.3.40.0070.01418.67
8.3.30.0150.00618.92
8.3.20.0040.00420.40
8.3.10.0040.00423.66
8.3.00.0000.00820.72
8.2.180.0140.00418.17
8.2.170.0170.00322.96
8.2.160.0070.00720.38
8.2.150.0040.00424.18
8.2.140.0050.00224.66
8.2.130.0150.00426.16
8.2.120.0080.00020.98
8.2.110.0090.00319.17
8.2.100.0040.00720.48
8.2.90.0100.00019.11
8.2.80.0000.00817.97
8.2.70.0000.01017.50
8.2.60.0060.00317.77
8.2.50.0090.00318.07
8.2.40.0040.00419.70
8.2.30.0000.00718.24
8.2.20.0000.00817.73
8.2.10.0050.00317.99
8.2.00.0000.00817.66
8.1.280.0070.00725.92
8.1.270.0060.00323.92
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0060.00317.66
8.1.230.0090.00319.09
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0000.00817.36
8.1.190.0000.00817.22
8.1.180.0030.00618.10
8.1.170.0040.00418.66
8.1.160.0030.00322.06
8.1.150.0000.00718.62
8.1.140.0040.00417.49
8.1.130.0030.00317.70
8.1.120.0050.00317.42
8.1.110.0040.00417.52
8.1.100.0040.00417.30
8.1.90.0050.00317.35
8.1.80.0030.00317.46
8.1.70.0030.00317.29
8.1.60.0050.00217.48
8.1.50.0030.00617.52
8.1.40.0060.00317.52
8.1.30.0030.00617.61
8.1.20.0070.00017.62
8.1.10.0000.00717.39
8.1.00.0070.00017.41
8.0.300.0070.00018.77
8.0.290.0000.00716.63
8.0.280.0050.00318.31
8.0.270.0000.00717.27
8.0.260.0000.00617.27
8.0.250.0070.00016.94
8.0.240.0000.00616.96
8.0.230.0000.00716.88
8.0.220.0070.00016.79
8.0.210.0030.00316.88
8.0.200.0000.00716.94
8.0.190.0080.00016.84
8.0.180.0030.00316.84
8.0.170.0050.00316.83
8.0.160.0070.00016.88
8.0.150.0080.00016.76
8.0.140.0040.00416.80
8.0.130.0000.00513.28
8.0.120.0000.00816.79
8.0.110.0070.00016.86
8.0.100.0040.00416.86
8.0.90.0040.00416.67
8.0.80.0120.00316.78
8.0.70.0080.00016.88
8.0.60.0050.00216.79
8.0.50.0040.00416.89
8.0.30.0050.01317.23
8.0.20.0090.01017.41
8.0.10.0050.00316.96
8.0.00.0100.00916.75
7.4.330.0050.00015.02
7.4.320.0000.00616.63
7.4.300.0000.00616.58
7.4.290.0050.00216.49
7.4.280.0020.00516.54
7.4.270.0070.00016.55
7.4.260.0050.00216.48
7.4.250.0040.00416.48
7.4.240.0020.00516.49
7.4.230.0030.00316.70
7.4.220.0130.01016.61
7.4.210.0060.00816.46
7.4.200.0000.00716.38
7.4.160.0160.00016.53
7.4.150.0100.00717.40
7.4.140.0090.00917.86
7.4.130.0170.00216.57
7.4.120.0100.01016.45
7.4.110.0130.00316.60
7.4.100.0120.00616.55
7.4.90.0100.00716.56
7.4.80.0080.00819.39
7.4.70.0100.00716.57
7.4.60.0130.00316.48
7.4.50.0000.00816.40
7.4.40.0140.00716.47
7.4.30.0120.00316.63
7.4.00.0050.01114.71
7.3.330.0030.00313.18
7.3.320.0030.00313.23
7.3.310.0030.00316.45
7.3.300.0000.00716.33
7.3.290.0080.00716.36
7.3.280.0090.00816.33
7.3.270.0130.00417.40
7.3.260.0060.01216.55
7.3.250.0100.01016.38
7.3.240.0060.01616.66
7.3.230.0100.00716.51
7.3.210.0150.00616.48
7.3.200.0150.00419.39
7.3.190.0100.01016.48
7.3.180.0150.00016.50
7.3.170.0060.01116.27
7.3.160.0060.00916.48
7.3.120.0070.00714.86
7.3.110.0050.00914.81
7.3.100.0070.00714.88
7.3.90.0060.00914.67
7.3.80.0030.00914.64
7.3.70.0040.00715.03
7.3.60.0000.01514.96
7.3.50.0080.00414.71
7.3.40.0090.00414.71
7.3.30.0090.00314.91
7.3.20.0060.00916.55
7.3.10.0090.00516.79
7.3.00.0080.00616.58
7.2.330.0180.00516.54
7.2.320.0110.00616.74
7.2.310.0110.01116.41
7.2.300.0130.00816.68
7.2.290.0030.02016.66
7.2.250.0070.01115.25
7.2.240.0090.00915.00
7.2.230.0040.00815.23
7.2.220.0070.00714.98
7.2.210.0070.00614.88
7.2.200.0060.00614.96
7.2.190.0090.00615.02
7.2.180.0070.01114.74
7.2.170.0040.01114.84
7.2.130.0060.01216.87
7.2.120.0060.00616.91
7.2.110.0110.00316.79
7.2.100.0100.00316.87
7.2.90.0060.00617.00
7.2.80.0030.01016.93
7.2.70.0080.00616.97
7.2.60.0060.00916.79
7.2.50.0060.00917.00
7.2.40.0040.00817.01
7.2.30.0030.00717.03
7.2.20.0070.00716.57
7.2.10.0040.01116.97
7.2.00.0050.00918.32
7.1.330.0080.00615.98
7.1.320.0000.01115.96
7.1.310.0030.01115.79
7.1.300.0040.01115.93
7.1.290.0060.00315.82
7.1.280.0030.01015.58
7.1.270.0030.01015.73
7.1.260.0070.00715.94
7.1.250.0000.01515.98
7.1.100.0060.00618.14
7.1.70.0000.00717.30
7.1.60.0030.00717.32
7.1.50.0050.00517.11
7.1.40.0110.00316.67
7.1.30.0040.00716.71
7.1.20.0130.00316.78
7.1.10.0040.00416.79
7.1.00.0030.00516.51
7.0.200.0040.00416.89
7.0.190.0060.00616.74
7.0.180.0050.00316.43
7.0.170.0040.00416.24
7.0.160.0030.01016.26
7.0.150.0000.00916.43
7.0.140.0030.00716.25
7.0.130.0030.00516.59
7.0.120.0000.00916.35
7.0.110.0030.00516.50
7.0.100.0040.01116.28
7.0.90.0060.00916.34
7.0.80.0000.00716.48
7.0.70.0000.00716.58
7.0.60.0050.00316.07
7.0.50.0000.00716.33
7.0.40.0000.01016.03
7.0.30.0000.00816.03
7.0.20.0000.00716.03
7.0.10.0080.00016.03
7.0.00.0050.00216.03
5.6.300.0030.04120.68
5.6.290.0030.04020.87
5.6.280.0130.03220.89
5.6.270.0070.03821.05
5.6.260.0030.04120.85
5.6.250.0000.04420.82
5.6.240.0070.04120.84
5.6.230.0070.03720.98
5.6.220.0070.03720.87
5.6.210.0070.03720.63
5.6.200.0070.04420.84
5.6.190.0030.04420.94
5.6.180.0100.07920.94
5.6.170.0000.04320.76
5.6.160.0000.04420.99
5.6.150.0030.04020.84
5.6.140.0030.04020.93
5.6.130.0000.04720.99
5.6.120.0000.04320.96
5.6.110.0000.04920.75
5.6.100.0000.04420.78
5.6.90.0070.04720.91
5.6.80.0030.04520.44
5.6.70.0030.04320.21
5.6.60.0030.03820.16
5.6.50.0000.04120.21
5.6.40.0030.04320.42
5.6.30.0030.06320.20
5.6.20.0000.04920.21
5.6.10.0070.03420.22
5.6.00.0240.04020.29
5.5.380.0000.04017.68
5.5.370.0070.05217.63
5.5.360.0030.03817.52
5.5.350.0000.04117.57
5.5.340.0030.03818.18
5.5.330.0030.04317.87
5.5.320.0070.04618.06
5.5.310.0000.04318.13
5.5.300.0100.03218.00
5.5.290.0070.04018.06
5.5.280.0100.03317.86
5.5.270.0070.03617.73
5.5.260.0070.03718.11
5.5.250.0070.05617.82
5.5.240.0030.03717.51
5.5.230.0030.04417.52
5.5.220.0070.03217.46
5.5.210.0030.04517.09
5.5.200.0030.03717.55
5.5.190.0070.06317.44
5.5.180.0000.04217.45
5.5.160.0030.03617.41
5.5.150.0000.04117.36
5.5.140.0000.04917.21
5.5.130.0070.03317.21
5.5.120.0030.03717.38
5.5.110.0000.04417.45
5.5.100.0000.04516.96
5.5.90.0030.03717.31
5.5.80.0070.05816.96
5.5.70.0000.04217.10
5.5.60.0000.06317.27
5.5.50.0000.04017.27
5.5.40.0070.04117.24
5.5.30.0000.04816.95
5.5.20.0000.05116.98
5.5.10.0040.03917.38
5.5.00.0070.03717.26
5.4.450.0100.03219.31
5.4.440.0030.04119.31
5.4.430.0140.03819.53
5.4.420.0030.04019.48
5.4.410.0070.03619.29
5.4.400.0030.03619.00
5.4.390.0070.06119.11
5.4.380.0030.05718.95
5.4.370.0130.03419.20
5.4.360.0100.03219.00
5.4.350.0030.03619.18
5.4.340.0070.03418.98
5.4.320.0000.04019.09
5.4.310.0000.04318.95
5.4.300.0000.04819.14
5.4.290.0100.07019.20
5.4.280.0030.04119.20
5.4.270.0070.04019.05
5.4.260.0030.03718.88
5.4.250.0060.03518.98
5.4.240.0030.08119.07
5.4.230.0230.04019.11
5.4.220.0130.03819.05
5.4.210.0170.03719.20
5.4.200.0000.08019.13
5.4.190.0070.05918.94
5.4.180.0000.04619.06
5.4.170.0030.03819.05
5.4.160.0060.05818.87
5.4.150.0030.03819.21
5.4.140.0030.03616.59
5.4.130.0030.05916.66
5.4.120.0060.03916.57
5.4.110.0030.03516.48
5.4.100.0070.03316.73
5.4.90.0030.03916.48
5.4.80.0030.03716.48
5.4.70.0030.05216.71
5.4.60.0000.03816.57
5.4.50.0000.03716.46
5.4.40.0030.03416.66
5.4.30.0030.03716.67
5.4.20.0030.04116.67
5.4.10.0000.04516.66
5.4.00.0100.04216.12
5.3.290.0100.06116.03
5.3.280.0000.04816.03
5.3.270.0070.03916.03
5.3.260.0030.05816.03
5.3.250.0000.04416.03
5.3.240.0000.06416.03
5.3.230.0030.04616.03
5.3.220.0030.04016.03
5.3.210.0030.03716.03
5.3.200.0030.07416.03
5.3.190.0030.04516.03
5.3.180.0070.04216.03
5.3.170.0000.04716.03
5.3.160.0100.05816.03
5.3.150.0030.04216.03
5.3.140.0000.03916.03
5.3.130.0100.03316.03
5.3.120.0030.04016.03
5.3.110.0000.04116.03
5.3.100.0000.04716.03
5.3.90.0070.03316.03
5.3.80.0120.02816.03
5.3.70.0000.04116.03
5.3.60.0000.04116.03
5.3.50.0030.06516.03
5.3.40.0000.07316.03
5.3.30.0000.03616.03
5.3.20.0060.07116.03
5.3.10.0060.04516.03
5.3.00.0000.05016.03

preferences:
50.18 ms | 401 KiB | 5 Q