3v4l.org

run code in 300+ PHP versions simultaneously
<?php $big = ['html', 'body', 'div', 'body','table', 'tbody', 'tr', 'td']; $small = ['body', 'div', 'td']; $wrong = ['td', 'body', 'div']; function isSubsequence($haystack,$needle){ if(count($needle) > count($haystack)) return false; $keys = array_keys($needle); $ptr = 0; $len = count($needle); foreach($haystack as $element){ if($ptr === $len) return true; if($needle[$keys[$ptr]] === $element) $ptr++; } return $ptr === $len; } var_dump(isSubsequence($big, $small)); var_dump(isSubsequence($big, $wrong));

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.140.0120.00917.51
8.4.130.0140.00717.55
8.4.120.0120.00720.28
8.4.110.0110.01022.36
8.4.100.0130.00618.65
8.4.90.0060.01318.76
8.4.80.0140.00619.54
8.4.70.0110.00518.07
8.4.60.0160.00418.68
8.4.50.0090.01118.63
8.4.40.0080.00019.24
8.4.30.0100.01020.42
8.4.20.0100.01022.23
8.4.10.0000.00919.38
8.3.270.0110.00916.54
8.3.260.0120.00816.50
8.3.250.0090.01118.87
8.3.240.0090.00916.64
8.3.230.0100.00916.51
8.3.220.0040.00317.20
8.3.210.0110.00716.62
8.3.200.0050.00516.62
8.3.190.0110.00617.04
8.3.180.0150.00416.71
8.3.170.0070.01119.09
8.3.160.0070.00717.09
8.3.150.0040.01419.00
8.3.140.0050.00316.60
8.3.130.0080.00018.55
8.3.120.0060.00320.75
8.3.110.0060.00316.65
8.3.100.0040.00424.06
8.3.90.0080.00016.63
8.3.80.0060.00318.31
8.3.70.0110.00718.43
8.3.60.0100.01018.55
8.3.50.0070.01018.52
8.3.40.0120.00318.78
8.3.30.0120.00318.84
8.3.20.0040.00421.60
8.3.10.0050.00321.95
8.3.00.0040.00420.57
8.2.290.0060.00220.35
8.2.280.0080.01020.30
8.2.270.0120.00622.16
8.2.260.0060.00316.66
8.2.250.0050.00316.56
8.2.240.0120.00619.00
8.2.230.0070.00420.94
8.2.220.0110.00037.54
8.2.210.0040.00426.77
8.2.200.0090.00018.29
8.2.190.0090.00618.29
8.2.180.0180.00418.18
8.2.170.0070.00722.96
8.2.160.0070.01021.05
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0090.00021.07
8.2.110.0030.00621.06
8.2.100.0030.00917.91
8.2.90.0030.00618.02
8.2.80.0080.00020.39
8.2.70.0030.00518.04
8.2.60.0060.00318.16
8.2.50.0000.00818.10
8.2.40.0000.00719.30
8.2.30.0030.00619.30
8.2.20.0070.00018.01
8.2.10.0050.00318.81
8.2.00.0000.00719.22
8.1.330.0100.00921.68
8.1.320.0150.00716.07
8.1.310.0000.00918.42
8.1.300.0030.00619.83
8.1.290.0100.00018.88
8.1.280.0030.01325.92
8.1.270.0000.00822.11
8.1.260.0090.00026.35
8.1.250.0050.00228.09
8.1.240.0000.00822.14
8.1.230.0070.00422.88
8.1.220.0060.00317.74
8.1.210.0040.00419.04
8.1.200.0030.00717.36
8.1.190.0060.00317.35
8.1.180.0000.00818.10
8.1.170.0000.00818.65
8.1.160.0000.00719.05
8.1.150.0000.00818.83
8.1.140.0040.00418.94
8.1.130.0040.00417.50
8.1.120.0000.00717.48
8.1.110.0000.00817.44
8.1.100.0000.00917.53
8.1.90.0040.00417.42
8.1.80.0000.00817.36
8.1.70.0000.00717.48
8.1.60.0030.00517.64
8.1.50.0050.00317.54
8.1.40.0000.00917.43
8.1.30.0030.00517.52
8.1.20.0060.00317.70
8.1.10.0000.00817.54
8.1.00.0030.00517.49
8.0.300.0070.00019.98
8.0.290.0000.00816.75
8.0.280.0030.00318.44
8.0.270.0000.01017.32
8.0.260.0000.00716.82
8.0.250.0000.00816.95
8.0.240.0050.00216.91
8.0.230.0080.00016.85
8.0.220.0040.00416.95
8.0.210.0040.00416.88
8.0.200.0030.00316.93
8.0.190.0040.00416.85
8.0.180.0040.00416.93
8.0.170.0090.00016.82
8.0.160.0020.00516.83
8.0.150.0040.00416.71
8.0.140.0080.00416.90
8.0.130.0050.00013.41
8.0.120.0040.00416.76
8.0.110.0040.00416.95
8.0.100.0030.00516.86
8.0.90.0030.00616.79
8.0.80.0130.00316.94
8.0.70.0050.00216.95
8.0.60.0040.00416.82
8.0.50.0000.00716.91
8.0.30.0060.01517.21
8.0.20.0090.00916.98
8.0.10.0030.00517.07
8.0.00.0110.01416.83
7.4.330.0000.00515.55
7.4.320.0000.00616.49
7.4.300.0030.00316.42
7.4.290.0000.00716.39
7.4.280.0080.00016.58
7.4.270.0000.00616.46
7.4.260.0000.00613.20
7.4.250.0080.00016.46
7.4.240.0000.00716.50
7.4.230.0000.00716.67
7.4.220.0020.00516.64
7.4.210.0100.00616.59
7.4.200.0000.00816.51
7.4.130.0150.00316.55
7.4.120.0170.00616.37
7.4.110.0110.00616.45
7.4.100.0100.00616.64
7.4.90.0070.01116.52
7.4.80.0080.00919.39
7.4.70.0090.00616.40
7.4.60.0070.01016.46
7.4.50.0140.00316.45
7.4.40.0040.01216.52
7.4.10.0090.00914.87
7.4.00.0030.01414.80
7.3.330.0050.00216.38
7.3.320.0000.00513.39
7.3.310.0030.00316.24
7.3.300.0030.00316.36
7.3.290.0040.00416.37
7.3.280.0090.00616.37
7.3.260.0100.00916.50
7.3.240.0100.00716.56
7.3.230.0130.00416.48
7.3.210.0080.00816.36
7.3.200.0140.00316.44
7.3.190.0130.00316.39
7.3.180.0130.00716.56
7.3.170.0150.00416.31
7.3.160.0070.01016.71
7.3.130.0060.00915.14
7.3.120.0030.01314.57
7.3.110.0060.00714.75
7.3.100.0030.01114.84
7.3.90.0050.00814.86
7.3.80.0080.00414.83
7.3.70.0070.00714.86
7.3.60.0080.00514.70
7.3.50.0100.00414.78
7.3.40.0090.00414.74
7.3.30.0050.00814.76
7.3.20.0060.00916.09
7.3.10.0010.01215.98
7.3.00.0060.00615.97
7.2.330.0060.01216.69
7.2.320.0080.01616.71
7.2.310.0110.00616.75
7.2.300.0110.01216.82
7.2.290.0070.01416.73
7.2.260.0030.01715.03
7.2.250.0160.00315.09
7.2.240.0060.00814.93
7.2.230.0070.00614.91
7.2.220.0010.01414.96
7.2.210.0070.00614.93
7.2.200.0060.00915.07
7.2.190.0080.00714.98
7.2.180.0090.00515.01
7.2.170.0090.00715.13
7.2.160.0050.00814.93
7.2.150.0070.00716.33
7.2.140.0070.00616.38
7.2.130.0050.01016.34
7.2.120.0070.00516.40
7.2.110.0070.00816.30
7.2.100.0040.00916.31
7.2.90.0030.00916.40
7.2.80.0090.00616.34
7.2.70.0010.01316.50
7.2.60.0040.00916.31
7.2.50.0040.00916.34
7.2.40.0050.01016.31
7.2.30.0040.01016.44
7.2.20.0060.00816.37
7.2.10.0090.00616.32
7.2.00.0070.00616.25
7.1.330.0040.00915.21
7.1.320.0060.00915.24
7.1.310.0060.00615.15
7.1.300.0060.00715.16
7.1.290.0060.00815.16
7.1.280.0100.00815.25
7.1.270.0050.00715.21
7.1.260.0050.00615.03
7.1.250.0050.00615.15
7.1.240.0060.00616.05
7.1.230.0080.00015.61
7.1.220.0060.00915.94
7.1.210.0030.00715.77
7.1.200.0040.01115.78
7.1.190.0030.01015.63
7.1.180.0080.00015.67
7.1.170.0070.00715.87
7.1.160.0070.00715.61
7.1.150.0040.01115.64
7.1.140.0100.00015.58
7.1.130.0030.00715.96
7.1.120.0030.01015.92
7.1.110.0090.00615.68
7.1.100.0030.00615.78
7.1.90.0040.00916.01
7.1.80.0060.00615.74
7.1.70.0100.00015.95
7.1.60.0120.00415.67
7.1.50.0060.00315.93
7.1.40.0000.01115.83
7.1.30.0070.00316.00
7.1.20.0090.00315.51
7.1.10.0000.00715.72
7.1.00.0030.00915.82

preferences:
32.11 ms | 403 KiB | 5 Q