3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parse(array $lines): array { $result = []; foreach ($lines as $line) { $split = explode(': ', $line, 2); switch ($split[0]) { case 'file': unset($ref); $ref = [null, null, null]; $result[] = &$ref; break; case 'Artist': $ref[0] = $split[1]; break; case 'Album': $ref[1] = $split[1]; break; case 'Title': $ref[2] = $split[1]; break; } } return $result; } $array = [ 'MPD 0.23.5', 'file: Blondie/Parallel_Lines/12_Just_Go_Away.flac', 'Last-Modified: 2016-06-05T17:15:07Z', 'Format: 44100:16:2', 'Album: Parallel Lines', 'AlbumArtist: Blondie', 'Artist: Blondie', 'Composer: Debbie Harry', 'Date: 1978', 'Genre: Rock', 'Title: Just Go Away', 'Track: 12', 'Time: 214', 'duration: 213.800', 'Pos: 0', 'Id: 745', 'file: Blondie/Parallel_Lines/13_Once_I_Had_a_Love-aka_The_Disco_Song-1978_version-.flac', 'Last-Modified: 2016-06-05T17:15:01Z', 'Format: 44100:16:2', 'Album: Parallel Lines', 'AlbumArtist: Blondie', 'Artist: Blondie', 'Composer: Chris Stein; Debbie Harry', 'Date: 1978', 'Genre: Rock', 'Title: Once I Had a Love (aka The Disco Song) (1978 version)', 'Track: 13', 'Time: 198', 'duration: 198.000', 'Pos: 1', 'Id: 746', 'file: Blondie/Parallel_Lines/14_Bang_a_Gong-Get_It_On-live-.flac', 'Last-Modified: 2016-06-05T17:15:03Z', 'Format: 44100:16:2', 'Album: Parallel Lines', 'AlbumArtist: Blondie', 'Artist: Blondie', 'Composer: Marc Bolan', 'Date: 1978', 'Genre: Rock', 'Title: Bang a Gong (Get It On) (live)', 'Track: 14', 'Time: 330', 'duration: 330.293', 'Pos: 2', 'Id: 747', '' ]; var_export(parse($array));

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.120.0120.00820.66
8.4.110.0110.00622.56
8.4.100.0120.00818.64
8.4.90.0120.00718.88
8.4.80.0140.00617.71
8.4.70.0060.00317.88
8.4.60.0110.01118.78
8.4.50.0080.00617.70
8.4.40.0130.00720.80
8.4.30.0160.00318.64
8.4.20.0070.01519.57
8.4.10.0160.00021.93
8.3.250.0100.00718.95
8.3.240.0140.00616.52
8.3.230.0130.00616.63
8.3.220.0070.00019.06
8.3.210.0100.00916.90
8.3.200.0060.00316.52
8.3.190.0110.00718.95
8.3.180.0090.00816.61
8.3.170.0040.01418.99
8.3.160.0120.00616.56
8.3.150.0110.00817.38
8.3.140.0150.00416.46
8.3.130.0030.00618.49
8.3.120.0030.00618.99
8.3.110.0050.00516.74
8.3.100.0040.00416.50
8.3.90.0040.00416.51
8.3.80.0060.00318.56
8.3.70.0060.00918.31
8.3.60.0300.00522.09
8.3.50.0100.00821.34
8.3.40.0140.01423.82
8.3.30.0260.00722.24
8.3.20.0220.00325.05
8.3.10.0190.00725.29
8.3.00.0160.00926.04
8.2.290.0070.00820.79
8.2.280.0130.00918.39
8.2.270.0120.00617.26
8.2.260.0090.00019.05
8.2.250.0000.01516.42
8.2.240.0030.00617.18
8.2.230.0090.00620.94
8.2.220.0090.00024.06
8.2.210.0000.00826.77
8.2.200.0060.00316.75
8.2.190.0060.01216.58
8.2.180.0180.01321.20
8.2.170.0210.01122.46
8.2.160.0260.00524.44
8.2.150.0250.00525.79
8.2.140.0150.00825.29
8.2.130.0150.00626.04
8.2.120.0250.00722.64
8.2.110.0170.00523.22
8.2.100.0170.00821.91
8.2.90.0150.00621.84
8.2.80.0220.00721.95
8.2.70.0150.00921.71
8.2.60.0200.00621.77
8.2.50.0190.01021.65
8.2.40.0160.00821.65
8.2.30.0190.00521.65
8.2.20.0140.00621.70
8.2.10.0230.00721.71
8.2.00.0240.00521.65
8.1.330.0100.00822.19
8.1.320.0110.00716.42
8.1.310.0040.00418.50
8.1.300.0060.00317.70
8.1.290.0050.00518.88
8.1.280.0170.00625.92
8.1.270.0150.00725.29
8.1.260.0200.00926.14
8.1.250.0250.00127.00
8.1.240.0210.00624.88
8.1.230.0180.00722.46
8.1.220.0200.00821.90
8.1.210.0160.00622.35
8.1.200.0150.00621.64
8.1.190.0150.01021.52
8.1.180.0280.00521.46
8.1.170.0280.00121.65
8.1.160.0180.00921.59
8.1.150.0180.00921.32
8.1.140.0210.00521.52
8.1.130.0160.00721.52
8.1.120.0220.00821.59
8.1.110.0240.00621.59
8.1.100.0240.00721.52
8.1.90.0300.00321.59
8.1.80.0260.00421.40
8.1.70.0230.00421.58
8.1.60.0200.01321.59
8.1.50.0290.00321.52
8.1.40.0200.01121.51
8.1.30.0210.00821.64
8.1.20.0260.00621.71
8.1.10.0230.00621.65
8.1.00.0200.00921.52
8.0.300.0150.00722.79
8.0.290.0140.01221.27
8.0.280.0290.00321.19
8.0.270.0260.00521.14
8.0.260.0180.01121.27
8.0.250.0270.00521.27
8.0.240.0300.00321.40
8.0.230.0180.01021.21
8.0.220.0210.00921.14
8.0.210.0240.00721.09
8.0.200.0240.00421.27
8.0.190.0230.00321.21
8.0.180.0190.00721.34
8.0.170.0240.00421.27
8.0.160.0260.00321.27
8.0.150.0270.00321.09
8.0.140.0230.00821.15
8.0.130.0200.00821.27
8.0.120.0230.00721.09
8.0.110.0210.01021.32
8.0.100.0230.00721.21
8.0.90.0250.00521.27
8.0.80.0250.01421.27
8.0.70.0220.00521.21
8.0.60.0240.00521.34
8.0.50.0250.00421.21
8.0.30.0220.00821.15
8.0.20.0180.00721.27
8.0.10.0230.00521.32

preferences:
28.03 ms | 403 KiB | 5 Q