3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sequences = ["6", "66", "67", "68", "69", "697", "698", "699"]; $data = ["69212345", "6209876544", "697986546"]; function get_longest_subsequence_element(array $sequences, $str){ $longestSequence = ""; for($strPosition = 0, $strPositionEnd = strlen($str) - 1; $strPosition < $strPositionEnd; $strPosition++){ for($strLength = 1, $strLengthEnd = strlen($str) - $strPosition; $strLength < $strLengthEnd; $strLength++){ if(in_array($sequence = substr($str, $strPosition, $strLength), $sequences) && $strLength > strlen($longestSequence)) $longestSequence = $sequence; } } return $longestSequence; } foreach($data as $str) echo get_longest_subsequence_element($sequences, $str) . "<br>"; ?>

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.0040.01416.50
8.3.50.0070.01118.18
8.3.40.0070.00718.70
8.3.30.0120.00618.69
8.3.20.0030.00520.20
8.3.10.0080.00020.48
8.3.00.0050.00320.89
8.2.180.0110.00418.05
8.2.170.0130.00622.96
8.2.160.0090.00619.04
8.2.150.0000.00725.66
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0070.00021.00
8.2.110.0030.00622.16
8.2.100.0000.01219.45
8.2.90.0000.00817.63
8.2.80.0030.00517.97
8.2.70.0030.00617.50
8.2.60.0080.00017.93
8.2.50.0040.00418.10
8.2.40.0050.00220.46
8.2.30.0040.00420.69
8.2.20.0000.00717.70
8.2.10.0040.00418.01
8.2.00.0040.00418.01
8.1.280.0110.01125.92
8.1.270.0080.00023.77
8.1.260.0030.00626.35
8.1.250.0000.00828.09
8.1.240.0040.00420.35
8.1.230.0090.00322.73
8.1.220.0030.00717.79
8.1.210.0040.00418.77
8.1.200.0070.00317.35
8.1.190.0030.00617.23
8.1.180.0040.00418.10
8.1.170.0040.00418.50
8.1.160.0030.00420.82
8.1.150.0000.00718.88
8.1.140.0070.00019.53
8.1.130.0070.00017.63
8.1.120.0070.00017.48
8.1.110.0030.00517.39
8.1.100.0040.00417.46
8.1.90.0000.00817.51
8.1.80.0030.00317.35
8.1.70.0000.00717.40
8.1.60.0000.00817.61
8.1.50.0000.00817.57
8.1.40.0050.00317.46
8.1.30.0030.00517.52
8.1.20.0060.00317.69
8.1.10.0030.00517.34
8.1.00.0050.00317.32
8.0.300.0050.00323.57
8.0.290.0040.00416.75
8.0.280.0030.00318.39
8.0.270.0000.00817.32
8.0.260.0030.00317.20
8.0.250.0030.00316.91
8.0.240.0070.00016.95
8.0.230.0070.00017.04
8.0.220.0040.00416.79
8.0.210.0050.00316.79
8.0.200.0000.00716.89
8.0.190.0030.00516.86
8.0.180.0000.00716.92
8.0.170.0080.00016.81
8.0.160.0030.00516.96
8.0.150.0000.00716.72
8.0.140.0070.00016.77
8.0.130.0030.00313.41
8.0.120.0000.00816.87
8.0.110.0070.00016.89
8.0.100.0000.00716.91
8.0.90.0030.00516.98
8.0.80.0040.01116.89
8.0.70.0050.00316.89
8.0.60.0000.00816.89
8.0.50.0040.00416.95
8.0.30.0100.00816.88
8.0.20.0120.00717.40
8.0.10.0040.00417.04
8.0.00.0060.01116.84
7.4.330.0000.00615.08
7.4.320.0030.00316.60
7.4.300.0030.00316.52
7.4.290.0050.00216.62
7.4.280.0040.00416.51
7.4.270.0040.00416.63
7.4.260.0000.00816.61
7.4.250.0000.00816.55
7.4.240.0030.00316.52
7.4.230.0040.00416.40
7.4.220.0120.00616.57
7.4.210.0070.01416.71
7.4.200.0040.00416.71
7.4.160.0060.01016.61
7.4.150.0100.00717.40
7.4.140.0160.00817.86
7.4.130.0130.00416.40
7.4.120.0070.01116.57
7.4.110.0090.01216.44
7.4.100.0070.01216.47
7.4.90.0000.01816.51
7.4.80.0100.00719.39
7.4.70.0130.00316.47
7.4.60.0130.00316.57
7.4.50.0090.00316.32
7.4.40.0170.00316.70
7.4.30.0100.01116.41
7.4.00.0100.00715.02
7.3.330.0000.00513.15
7.3.320.0060.00013.45
7.3.310.0050.00216.27
7.3.300.0030.00316.32
7.3.290.0090.00816.34
7.3.280.0120.00816.37
7.3.270.0150.00617.40
7.3.260.0140.00416.63
7.3.250.0080.01116.50
7.3.240.0140.00416.38
7.3.230.0170.00616.56
7.3.210.0120.00616.68
7.3.200.0170.00016.66
7.3.190.0090.00916.39
7.3.180.0040.01116.62
7.3.170.0100.00716.35
7.3.160.0130.00416.43
7.3.10.0150.00716.48
7.3.00.0240.00016.58
7.2.330.0090.00916.47
7.2.320.0060.01616.75
7.2.310.0070.01416.52
7.2.300.0090.00916.63
7.2.290.0070.01016.69
7.2.130.0140.01716.77
7.2.120.0200.00316.89
7.2.110.0110.00816.71
7.2.100.0180.00416.48
7.2.90.0200.01016.93
7.2.80.0170.00316.61
7.2.70.0160.00916.79
7.2.60.0130.00616.82
7.2.50.0100.01716.80
7.2.40.0130.01016.86
7.2.30.0150.01216.76
7.2.20.0140.01416.73
7.2.10.0260.00816.87
7.2.00.0190.00616.78
7.1.250.0170.00715.43
7.1.240.0120.00615.44
7.1.230.0180.00515.52
7.1.220.0150.01115.38
7.1.210.0120.00815.41
7.1.200.0120.00815.79
7.1.190.0210.00415.36
7.1.180.0120.01215.73
7.1.170.0150.01115.81
7.1.160.0130.01015.62
7.1.150.0090.01315.78
7.1.140.0160.01015.62
7.1.130.0220.00215.68
7.1.120.0190.00815.27
7.1.110.0120.01315.37
7.1.100.0130.01615.79
7.1.90.0080.01315.69
7.1.80.0200.00315.62
7.1.70.0060.00916.37
7.1.60.0140.00517.63
7.1.50.0090.00615.91
7.1.40.0070.00715.75
7.1.30.0140.00915.59
7.1.20.0140.00015.72
7.1.10.0120.00415.53
7.1.00.0170.03719.06
7.0.330.0070.01515.28
7.0.320.0090.00915.08
7.0.310.0130.01315.22
7.0.300.0150.00015.29
7.0.290.0140.00415.05
7.0.280.0110.00815.34
7.0.270.0200.00215.36
7.0.260.0120.01215.21
7.0.250.0110.01415.26
7.0.240.0130.01315.25
7.0.230.0210.00915.11
7.0.220.0170.00615.39
7.0.210.0110.01115.20
7.0.200.0230.00715.14
7.0.190.0110.01115.16
7.0.180.0180.00015.45
7.0.170.0060.01515.10
7.0.160.0100.00915.34
7.0.150.0110.01115.22
7.0.140.0140.00615.43
7.0.130.0150.01215.54
7.0.120.0140.01415.32
7.0.110.0130.01015.51
7.0.100.0200.00015.07
7.0.90.0180.00915.48
7.0.80.0130.00915.19
7.0.70.0200.00615.44
7.0.60.0110.03618.60
7.0.50.0080.04216.55
7.0.40.0110.03516.86
7.0.30.0150.03316.88
7.0.20.0380.02816.79
7.0.10.0280.03916.80
7.0.00.0200.03416.77
5.6.380.0080.01114.00
5.6.370.0000.01514.39
5.6.360.0060.00614.38
5.6.350.0090.00314.53
5.6.340.0040.01514.37
5.6.330.0080.00814.24
5.6.320.0060.00614.18
5.6.310.0060.01214.28
5.6.300.0090.00914.59
5.6.290.0110.00714.59
5.6.280.0100.03917.59
5.6.270.0200.00314.50
5.6.260.0150.00313.93
5.6.250.0110.00414.22
5.6.240.0060.01214.15
5.6.230.0070.01114.43
5.6.220.0040.00814.15
5.6.210.0080.04817.49
5.6.200.0020.02816.17
5.6.190.0100.03517.43
5.6.180.0050.04217.37
5.6.170.0120.03017.41
5.6.160.0300.03217.32
5.6.150.0250.03517.25
5.6.140.0270.03317.35
5.6.130.0290.03217.20
5.6.120.0080.03417.48
5.6.110.0040.03817.41
5.6.100.0230.03517.36
5.6.90.0220.03317.24
5.6.80.0270.03716.96
5.6.70.0280.03216.95
5.6.60.0230.03316.89
5.6.50.0300.03216.93
5.6.40.0200.03617.04
5.6.30.0310.03216.85
5.6.20.0270.03616.81
5.6.10.0270.03616.89
5.6.00.0230.03016.79
5.5.380.0040.00811.21
5.5.370.0050.00511.29
5.5.360.0030.01010.92
5.5.350.0100.04215.84
5.5.340.0070.04314.64
5.5.330.0070.04015.75
5.5.320.0180.04315.85
5.5.310.0080.03815.81
5.5.300.0220.03115.56
5.5.290.0270.02815.70
5.5.280.0060.03315.61
5.5.270.0130.03015.63
5.5.260.0270.02715.58
5.5.250.0250.03015.59
5.5.240.0300.02715.30
5.5.230.0230.03015.37
5.5.220.0250.03015.28
5.5.210.0220.02915.37
5.5.200.0250.03515.17
5.5.190.0290.03215.34
5.5.180.0280.03015.27
5.5.170.0040.00711.17
5.5.160.0220.03115.19
5.5.150.0340.03015.36
5.5.140.0320.03915.26
5.5.130.0270.02915.27
5.5.120.0330.02815.27
5.5.110.0310.03615.32
5.5.100.0260.02815.24
5.5.90.0230.03315.35
5.5.80.0290.02415.21
5.5.70.0270.02815.31
5.5.60.0180.03315.31
5.5.50.0250.02915.38
5.5.40.0410.02015.29
5.5.30.0330.02815.29
5.5.20.0180.04115.28
5.5.10.0260.03415.18
5.5.00.0290.03315.16

preferences:
71.78 ms | 401 KiB | 5 Q