3v4l.org

run code in 300+ PHP versions simultaneously
<?php $handle = fopen('music_list.txt', 'r'); $blocks = array(); $currentBlock = array(); while (!feof($handle)) { $line = fgets($handle); if (trim($line) == '') { if ($currentBlock) { $blocks[] = $currentBlock; $currentBlock = array(); } } else { $currentBlock[] = $line; } } fclose($handle); if ($currentBlock) { $blocks[] = $currentBlock; } function findTerm($term, $haystack) { $count = 0; foreach($haystack as $album) { if(in_array($term, $album)) { return $count; } } return false; } $searchTerm = "strategy"; $album = findTerm($searhTerm, $blocks); if(isset($album)) { echo "Found term: <b>$searchTerm</b><br>"; echo "In album: ".$blocks[$album][2]; } ?>

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.01818.55
8.3.50.0160.00621.92
8.3.40.0160.00318.96
8.3.30.0200.00318.56
8.3.20.0040.00418.77
8.3.10.0070.01420.71
8.3.00.0080.00417.50
8.2.180.0100.01316.75
8.2.170.0130.00722.96
8.2.160.0140.00422.30
8.2.150.0130.00624.18
8.2.140.0060.00324.66
8.2.130.0070.00026.16
8.2.120.0040.00419.48
8.2.110.0060.00322.09
8.2.100.0060.00617.72
8.2.90.0000.00819.07
8.2.80.0040.00417.97
8.2.70.0060.00317.63
8.2.60.0030.00717.91
8.2.50.0040.00418.07
8.2.40.0000.00818.09
8.2.30.0080.00019.86
8.2.20.0040.00417.74
8.2.10.0040.00417.67
8.2.00.0030.00517.69
8.1.280.0140.00725.92
8.1.270.0100.00022.01
8.1.260.0100.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00322.25
8.1.230.0080.00317.45
8.1.220.0060.00317.74
8.1.210.0000.01018.77
8.1.200.0090.00017.35
8.1.190.0030.00517.53
8.1.180.0040.00418.10
8.1.170.0040.00418.76
8.1.160.0000.00818.89
8.1.150.0040.00418.60
8.1.140.0050.00317.41
8.1.130.0030.00317.84
8.1.120.0020.00517.32
8.1.110.0070.00017.40
8.1.100.0050.00217.46
8.1.90.0050.00217.38
8.1.80.0070.00017.48
8.1.70.0030.00317.28
8.1.60.0050.00317.57
8.1.50.0040.00417.50
8.1.40.0080.00017.36
8.1.30.0070.00017.49
8.1.20.0060.00317.59
8.1.10.0000.00717.63
8.1.00.0040.00417.52
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0040.00418.37
8.0.270.0000.00717.23
8.0.260.0070.00018.74
8.0.250.0040.00416.89
8.0.240.0030.00616.91
8.0.230.0040.00416.94
8.0.220.0070.00016.97
8.0.210.0070.00016.93
8.0.200.0030.00316.96
8.0.190.0030.00517.00
8.0.180.0000.00816.97
8.0.170.0060.00316.92
8.0.160.0000.00716.84
8.0.150.0030.00716.98
8.0.140.0050.00316.87
8.0.130.0060.00013.43
8.0.120.0040.00416.99
8.0.110.0030.00517.00
8.0.100.0050.00316.86
8.0.90.0000.00717.02
8.0.80.0070.01016.99
8.0.70.0000.00817.01
8.0.60.0070.00016.87
8.0.50.0000.00716.81
8.0.30.0140.00817.15
8.0.20.0120.00617.40
8.0.10.0050.00317.02
8.0.00.0080.01316.76
7.4.330.0100.00014.89
7.4.320.0090.00916.52
7.4.300.0060.01216.39
7.4.290.0000.01716.51
7.4.280.0050.00316.40
7.4.270.0050.00316.51
7.4.260.0040.00413.40
7.4.250.0110.00516.47
7.4.240.0080.00016.32
7.4.230.0090.00516.41
7.4.220.0210.01016.46
7.4.210.0190.02116.44
7.4.200.0080.00416.52
7.4.190.0040.00416.44
7.4.160.0360.01816.52
7.4.150.0300.01517.40
7.4.140.0220.01917.14
7.4.130.0320.01616.44
7.4.120.0280.01216.45
7.4.110.0940.02416.47
7.4.100.0590.03316.53
7.4.90.0270.02216.57
7.4.80.0130.02719.03
7.4.70.1340.01616.42
7.4.60.0280.02716.45
7.4.50.0230.01216.34
7.4.40.0200.00322.27
7.4.30.0100.01316.36
7.4.00.0060.01015.11
7.3.330.0030.00313.23
7.3.320.0000.01413.32
7.3.310.0060.01116.26
7.3.300.0140.00016.24
7.3.290.0150.00816.34
7.3.280.0290.01216.30
7.3.270.0250.00617.40
7.3.260.0360.02318.24
7.3.250.0390.01416.24
7.3.240.0370.01116.29
7.3.230.0590.02916.41
7.3.210.0680.02416.41
7.3.200.0140.02619.39
7.3.190.0210.02416.27
7.3.180.0140.02116.33
7.3.170.0260.02316.27
7.3.160.0410.01216.16
7.3.120.0110.01114.65
7.2.330.0110.00916.56
7.2.320.1360.03716.58
7.2.310.0260.02016.71
7.2.300.0500.02216.55
7.2.290.0330.01716.38
7.2.60.0100.00316.84
7.2.00.0000.01319.35
7.1.200.0070.01115.77
7.1.100.0060.00918.07
7.1.70.0040.00416.79
7.1.60.0030.02019.40
7.1.50.0040.00817.06
7.1.00.0030.03322.29
7.0.200.0260.00716.48
7.0.140.0130.06322.15
7.0.60.0130.07719.94
7.0.50.0100.04717.84
7.0.40.0070.04319.69
7.0.30.0270.04319.71
7.0.20.0300.03319.89
7.0.10.0030.04319.88
7.0.00.0200.08019.95
5.6.280.0030.07721.10
5.6.210.0030.08320.48
5.6.200.0130.04318.23
5.6.190.0100.04020.39
5.6.180.3270.04720.50
5.6.170.0300.08020.45
5.6.160.0130.03020.31
5.6.150.0070.03718.12
5.6.140.0100.03317.99
5.6.130.0130.05718.14
5.6.120.0030.06021.01
5.6.110.0100.08321.02
5.6.100.0170.08020.98
5.6.90.0030.08021.00
5.6.80.0070.08020.48
5.5.350.0170.03720.45
5.5.340.0170.05020.86
5.5.330.0030.05020.16
5.5.320.0170.05720.89
5.5.310.0330.05320.13
5.5.300.0270.05020.90
5.5.290.0030.04017.96
5.5.280.0070.08320.78
5.5.270.0170.05320.92
5.5.260.0100.06720.79
5.5.250.0100.03720.50
5.5.240.0100.06320.10
5.4.450.0070.06719.38
5.4.440.0230.07719.26
5.4.430.0070.06319.39
5.4.420.0130.05019.38
5.4.410.0470.04019.22
5.4.400.0130.04719.07
5.4.390.3570.04018.93
5.4.380.0130.06019.05
5.4.370.0070.06319.07
5.4.360.0370.05719.01
5.4.350.0130.05019.10
5.4.340.0000.07319.19
5.4.320.0330.04019.18
5.4.310.0070.05719.05
5.4.300.0170.04719.05
5.4.290.0030.06019.07
5.4.280.2370.06019.02
5.4.270.0500.05318.82
5.4.260.0170.04718.84
5.4.250.0270.07719.05
5.4.240.0200.04019.02
5.4.230.0270.05719.00
5.4.220.0070.06019.05
5.4.210.0200.06318.82
5.4.200.0270.06719.06
5.4.190.0330.06019.02
5.4.180.0000.07018.88
5.4.170.0170.07718.94
5.4.160.4300.03319.00
5.4.150.4230.03719.05
5.4.140.0030.08316.37
5.4.130.0070.05316.45
5.4.120.0030.08316.50
5.4.110.0100.05316.47
5.4.100.0270.06716.27
5.4.90.0130.04316.52
5.4.80.0070.07316.26
5.4.70.0000.03716.41
5.4.60.0100.05316.23
5.4.50.0070.06716.25
5.4.40.0100.04716.49
5.4.30.0070.05016.22
5.4.20.0070.04716.22
5.4.10.0030.06016.44
5.4.00.4270.03315.75
5.3.290.4830.03714.59
5.3.280.0000.06314.58
5.3.270.0270.06314.43
5.3.260.3600.04714.42
5.3.250.0100.05714.59
5.3.240.3630.04014.57
5.3.230.0200.04714.39
5.3.220.2970.04314.40
5.3.210.0230.05014.40
5.3.200.0230.03714.48
5.3.190.0170.04314.45
5.3.180.0400.06014.31
5.3.170.0070.08014.27
5.3.160.0070.06014.43
5.3.150.0570.06014.60
5.3.140.0500.06314.61
5.3.130.3870.04014.30
5.3.120.0630.05314.47
5.3.110.0070.05714.39
5.3.100.0000.06013.87
5.3.90.0100.05713.83
5.3.80.0130.04713.79
5.3.60.0130.05313.80
5.3.50.0130.06313.72
5.3.40.0130.04713.73
5.3.30.0500.06313.73
5.3.20.0030.07313.49
5.3.10.0470.06313.39
5.3.00.0100.07313.42
5.2.170.0470.05311.84
5.2.160.0100.04010.93
5.2.150.0130.05010.88
5.2.140.0100.05310.91
5.2.130.0470.04011.88
5.2.120.0000.04710.87
5.2.110.0170.04310.73
5.2.100.0170.04010.78
5.2.90.0170.05310.91
5.2.80.0100.04010.84
5.2.70.0130.05310.88
5.2.60.0030.04710.81
5.2.50.0070.05710.81
5.2.40.0400.05711.82
5.2.30.0370.05311.85
5.2.20.0100.03710.65
5.2.10.0300.02711.82
5.2.00.0170.03010.46
5.1.60.0470.04311.88
5.1.50.0070.0379.80
5.1.40.0100.0339.84
5.1.30.0070.05313.88
5.1.20.0070.05313.88
5.1.10.0370.05013.88
5.1.00.0070.0409.80
5.0.50.0300.03713.88
5.0.40.0030.0338.42
5.0.30.0000.0478.42
5.0.20.0200.03713.88
5.0.10.0070.05013.88
5.0.00.0070.0538.42
4.4.90.0000.04013.88
4.4.80.0070.0338.42
4.4.70.0100.0278.42
4.4.60.0000.0378.42
4.4.50.0070.0278.42
4.4.40.0000.03313.88
4.4.30.0070.0208.42
4.4.20.0030.0278.42
4.4.10.0100.03713.91
4.4.00.0100.0438.42
4.3.110.0070.0208.42
4.3.100.0000.0308.42
4.3.90.0030.0238.42
4.3.80.0130.05013.90
4.3.70.0070.0208.42
4.3.60.0030.0238.42
4.3.50.1600.02013.88
4.3.40.1130.02013.88
4.3.30.0070.0238.42
4.3.20.0030.0238.42
4.3.10.0030.0238.42
4.3.00.0070.01313.91

preferences:
40.72 ms | 400 KiB | 5 Q