3v4l.org

run code in 300+ PHP versions simultaneously
<?php $handle = fopen('music_asdlist.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; } if(empty($blocks)) { echo "File import failed"; } else { $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.0090.00618.43
8.3.50.0090.00621.94
8.3.40.0040.01818.92
8.3.30.0090.00619.23
8.3.20.0050.00320.16
8.3.10.0040.00423.51
8.3.00.0000.00820.71
8.2.180.0060.01218.55
8.2.170.0070.01422.96
8.2.160.0070.00720.41
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0050.00322.16
8.2.110.0030.00621.96
8.2.100.0090.00317.72
8.2.90.0000.00819.09
8.2.80.0000.00817.97
8.2.70.0080.00017.63
8.2.60.0040.00417.80
8.2.50.0080.00018.07
8.2.40.0040.00418.22
8.2.30.0060.00317.97
8.2.20.0080.00017.68
8.2.10.0040.00417.64
8.2.00.0070.00017.76
8.1.280.0110.00425.92
8.1.270.0040.00422.08
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0030.00723.98
8.1.230.0040.00719.11
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0050.00517.23
8.1.190.0050.00317.64
8.1.180.0000.00918.10
8.1.170.0030.00618.65
8.1.160.0000.00822.03
8.1.150.0050.00218.49
8.1.140.0020.00517.40
8.1.130.0070.00017.86
8.1.120.0070.00017.42
8.1.110.0000.00717.36
8.1.100.0000.00817.44
8.1.90.0000.00717.35
8.1.80.0040.00417.48
8.1.70.0070.00017.26
8.1.60.0060.00317.58
8.1.50.0030.00617.50
8.1.40.0030.00617.52
8.1.30.0000.00817.61
8.1.20.0030.00617.66
8.1.10.0000.00817.47
8.1.00.0000.00817.60
8.0.300.0040.00418.77
8.0.290.0040.00417.16
8.0.280.0000.00718.34
8.0.270.0030.00316.90
8.0.260.0000.00716.77
8.0.250.0030.00317.07
8.0.240.0000.00817.00
8.0.230.0070.00316.91
8.0.220.0030.00316.89
8.0.210.0040.00416.89
8.0.200.0030.00317.04
8.0.190.0030.00316.93
8.0.180.0020.00517.01
8.0.170.0060.00317.01
8.0.160.0000.00817.00
8.0.150.0040.00416.90
8.0.140.0040.00416.84
8.0.130.0030.00313.43
8.0.120.0040.00416.84
8.0.110.0000.00817.00
8.0.100.0040.00416.97
8.0.90.0000.00717.03
8.0.80.0120.00316.93
8.0.70.0070.00016.89
8.0.60.0070.00016.95
8.0.50.0070.00016.86
8.0.30.0050.01516.97
8.0.20.0140.00517.40
8.0.10.0040.00416.95
8.0.00.0110.00716.75
7.4.330.0080.00415.05
7.4.320.0070.00716.54
7.4.300.0000.00816.34
7.4.290.0080.00816.26
7.4.280.0050.00516.48
7.4.270.0060.00616.48
7.4.260.0070.00716.38
7.4.250.0030.00616.45
7.4.240.0030.01316.49
7.4.230.0110.00516.39
7.4.220.0420.02416.43
7.4.210.0150.01216.45
7.4.200.0000.01416.43
7.4.190.0000.01316.55
7.4.160.0490.00616.47
7.4.150.0130.01017.40
7.4.140.0190.02117.86
7.4.130.0210.01216.49
7.4.120.0180.01016.51
7.4.110.0130.01716.37
7.4.100.0130.01716.57
7.4.90.0310.01416.34
7.4.80.0080.02116.45
7.4.70.0140.00816.50
7.4.60.0130.01716.46
7.4.50.0440.00616.47
7.4.40.0030.01322.77
7.4.30.0100.01416.35
7.4.00.0100.01014.84
7.3.330.0000.00813.39
7.3.320.0100.00013.44
7.3.310.0000.00916.15
7.3.300.0050.00216.17
7.3.290.0160.03016.22
7.3.280.0190.01516.28
7.3.270.0270.02117.40
7.3.260.0100.01016.32
7.3.250.0350.01616.40
7.3.240.0200.01316.30
7.3.230.0440.01916.39
7.3.210.0980.02216.41
7.3.200.0150.01219.39
7.3.190.1160.02716.43
7.3.180.0120.01616.32
7.3.170.0980.02316.30
7.3.160.0250.01716.20
7.3.120.0060.01214.82
7.2.330.0170.00716.47
7.2.320.0150.01416.58
7.2.310.0190.01516.46
7.2.300.0250.02016.54
7.2.290.1110.00616.68
7.2.60.0040.01116.82
7.2.00.0030.00919.40
7.1.200.0090.00615.89
7.1.100.0080.00017.90
7.1.70.0030.00617.14
7.1.60.0030.02419.29
7.1.50.0060.00916.79
7.1.00.0070.07722.42
7.0.200.0040.00416.78
7.0.140.0030.07722.11
7.0.60.0200.06719.94
7.0.50.0130.04017.80
7.0.40.0070.04319.87
7.0.30.0130.04719.89
7.0.20.0300.08319.96
7.0.10.0300.07019.98
7.0.00.0070.05319.71
5.6.280.0200.06020.79
5.6.210.0130.07720.73
5.6.200.0070.06718.16
5.6.190.0030.06720.36
5.6.180.0370.05320.27
5.6.170.0200.04720.32
5.6.160.0130.05320.43
5.6.150.0070.04318.15
5.6.140.0070.05718.14
5.6.130.0070.05018.18
5.6.120.0070.05321.14
5.6.110.0100.07021.13
5.6.100.0000.04721.14
5.6.90.0030.04721.12
5.6.80.0070.05720.39
5.6.70.0300.04020.38
5.5.350.0030.06720.40
5.5.340.0070.07717.94
5.5.330.0270.06020.94
5.5.320.0000.06320.13
5.5.310.0330.03720.11
5.5.300.0230.04720.71
5.5.290.0170.06020.94
5.5.280.0030.08320.88
5.5.270.0070.06720.94
5.5.260.0070.06720.83
5.5.250.0070.04020.62
5.5.240.0100.06320.25
5.4.450.0200.08019.36
5.4.440.0100.05719.36
5.4.430.0200.05319.23
5.4.420.0130.06019.54
5.4.410.0070.06319.26
5.4.400.0030.06319.04
5.4.390.0130.05318.91
5.4.380.0130.07719.14
5.4.370.0200.05719.03
5.4.360.0200.04319.10
5.4.350.0130.07019.06
5.4.340.0070.07019.08
5.4.320.0230.07718.54
5.4.310.0170.06319.19
5.4.300.0030.05718.95
5.4.290.0100.05018.85
5.4.280.0070.06018.84
5.4.270.0070.05719.07
5.4.260.0130.04719.05
5.4.250.0200.05018.88
5.4.240.0030.05718.95
5.4.230.0000.07319.10
5.4.220.0000.07019.04
5.4.210.0100.05018.96
5.4.200.0170.04318.84
5.4.190.0130.04718.82
5.4.180.0230.04019.09
5.4.170.0170.04719.05
5.4.160.0030.06319.04
5.4.150.0030.05719.10
5.4.140.0030.06716.39
5.4.130.0200.04316.33
5.4.120.0170.04316.55
5.4.110.0100.07316.49
5.4.100.0170.06316.25
5.4.90.0300.05016.26
5.4.80.0100.05316.50
5.4.70.0100.07716.43
5.4.60.0070.05716.39
5.4.50.0170.06316.41
5.4.40.0330.05016.19
5.4.30.0230.05716.46
5.4.20.0130.04716.44
5.4.10.0100.06016.49
5.4.00.0200.06015.88
5.3.290.0100.05014.48
5.3.280.0170.06314.50
5.3.270.0100.06314.32
5.3.260.0170.05314.51
5.3.250.0200.05314.32
5.3.240.0170.05714.46
5.3.230.0270.04314.61
5.3.220.0330.04014.50
5.3.210.0200.06714.54
5.3.200.0130.05314.42
5.3.190.0100.06014.36
5.3.180.0170.07014.34
5.3.170.0100.05314.44
5.3.160.0170.04314.44
5.3.150.0200.04714.43
5.3.140.0200.04014.41
5.3.130.0100.05714.40
5.3.120.0070.05714.26
5.3.110.0130.05314.26
5.3.100.0170.04713.88
5.3.90.0130.04713.85
5.3.80.0170.06313.79
5.3.70.0100.07313.79
5.3.60.0230.05013.95
5.3.50.0200.06013.77
5.3.40.0270.05013.94
5.3.30.0130.04313.63
5.3.20.0070.05313.49
5.3.10.0130.04313.30
5.3.00.0100.07713.41
5.2.170.0070.04010.88
5.2.160.0200.04310.94
5.2.150.0170.04710.90
5.2.140.0070.04310.91
5.2.130.0030.04310.88
5.2.120.0030.04310.81
5.2.110.0030.04710.91
5.2.100.0070.04310.86
5.2.90.0070.04310.88
5.2.80.0200.04710.86
5.2.70.0130.03710.88
5.2.60.0100.06310.68
5.2.50.0030.06710.79
5.2.40.0100.05010.90
5.2.30.0030.05010.77
5.2.20.0100.05310.80
5.2.10.0170.03710.71
5.2.00.0100.03710.69
5.1.60.0100.0409.88
5.1.50.0030.0379.70
5.1.40.0070.04310.01
5.1.30.0070.04010.16
5.1.20.0000.04710.11
5.1.10.0030.0409.89
5.1.00.0070.04310.03
5.0.50.0130.0238.22
5.0.40.0070.0308.28
5.0.30.0070.0438.10
5.0.20.0130.0238.12
5.0.10.0100.0238.06
5.0.00.0170.0378.12
4.4.90.0000.0307.95
4.4.80.0100.0337.95
4.4.70.0070.0207.95
4.4.60.0030.0237.95
4.4.50.0100.0207.95
4.4.40.0030.0437.95
4.4.30.0100.0307.95
4.4.20.0000.0307.95
4.4.10.0070.0207.95
4.4.00.0070.0477.95
4.3.110.0030.0237.95
4.3.100.0000.0277.95
4.3.90.0070.0237.95
4.3.80.0070.0337.95
4.3.70.0130.0175.82
4.3.60.0100.0207.95
4.3.50.0030.0275.75
4.3.40.0030.0337.95
4.3.30.0070.0204.52
4.3.20.0000.0337.95
4.3.10.0030.0237.95
4.3.00.0100.01713.14

preferences:
41.43 ms | 401 KiB | 5 Q