3v4l.org

run code in 300+ PHP versions simultaneously
<?php $apiKey = 'AIzaSyC7udxUIPhN213ilX9Reyc_ZzXN5_id5eg'; $channelId = 'UC226a2gZas0iS2KUtrF7oFw'; $maxResults = 50; $results = fetchLists($apiKey, $channelId, $maxResults); function fetchLists($apiKey, $channelId, $maxResults, $listsNextPage = null, $playlists = array()) { $ytApiUrl = 'https://www.googleapis.com/youtube/v3/playlists?maxResults=' . $maxResults . '&part=snippet&channelId=' . $channelId . '&key=' . $apiKey ; if($listsNextPage !== null){ $ytApiUrl .= '&pageToken=' . $listsNextPage; } $jsonLists = json_decode(file_get_contents($ytApiUrl)); $listsPageToken = (isset($jsonLists->nextPageToken)) ? $jsonLists->nextPageToken : null ; foreach ($jsonLists->items as $item) { $plId = $item->id; $list = array( "id" => $plId, "title" => $item->snippet->title, "published" => $item->snippet->publishedAt, "url" => 'https://www.youtube.com/playlist?list=' . $plId, "thumbnail" => $item->snippet->thumbnails->default->url, "videos" => [] ); fetchVideos($list, $playlists, $maxResults, $plId, $apiKey); } if($listsPageToken !== null){ return fetchLists($apiKey, $channelId, $maxResults, $listsPageToken, $playlists); } return $playlists; } function fetchVideos(&$list, &$playlists, &$maxResults, &$plId, &$apiKey, $vidsNextPage = null) { $plApiUrl = 'https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults='. $maxResults .'&playlistId=' . $plId . '&key=' . $apiKey; if($vidsNextPage !== null){ $plApiUrl .= '&pageToken=' . $vidsNextPage; } $jsonPlVideos = json_decode(file_get_contents($plApiUrl)); $videosPageToken = (isset($jsonPlVideos->nextPageToken)) ? $jsonPlVideos->nextPageToken : null ; foreach ($jsonPlVideos->items as $vid) { $video = array( "title" => $vid->snippet->title, "url" => 'https://www.youtube.com/watch?v=' . $vid->snippet->resourceId->videoId, "published" => $vid->snippet->publishedAt, "thumbnail" => $vid->snippet->thumbnails->default->url ); $list['videos'][] = $video; } $playlists[] = $list; if($videosPageToken !== null){ return fetchVideos($list, $playlists, $maxResults, $plId, $apiKey, $videosPageToken); } }

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.0120.00317.00
8.3.50.0070.01116.39
8.3.40.0090.00618.77
8.3.30.0120.00318.77
8.3.20.0000.00819.04
8.3.10.0090.00021.90
8.3.00.0080.00020.35
8.2.180.0070.00716.63
8.2.170.0140.00322.96
8.2.160.0030.01019.29
8.2.150.0090.00024.18
8.2.140.0050.00224.66
8.2.130.0000.00826.16
8.2.120.0080.00019.85
8.2.110.0100.00022.26
8.2.100.0000.01120.53
8.2.90.0030.00617.63
8.2.80.0050.00318.22
8.2.70.0060.00317.93
8.2.60.0050.00517.80
8.2.50.0080.00018.10
8.2.40.0000.00720.39
8.2.30.0070.00019.20
8.2.20.0060.00317.68
8.2.10.0000.00818.23
8.2.00.0040.00418.28
8.1.280.0100.01025.92
8.1.270.0040.00423.61
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0100.00019.23
8.1.230.0070.00419.05
8.1.220.0030.00617.78
8.1.210.0030.00618.77
8.1.200.0030.00616.99
8.1.190.0030.00617.11
8.1.180.0030.00618.10
8.1.170.0000.00818.95
8.1.160.0040.00422.14
8.1.150.0050.00318.93
8.1.140.0040.00419.68
8.1.130.0030.00317.67
8.1.120.0000.00717.41
8.1.110.0040.00417.51
8.1.100.0050.00317.43
8.1.90.0040.00417.52
8.1.80.0000.00717.52
8.1.70.0030.00517.39
8.1.60.0050.00317.68
8.1.50.0000.00817.57
8.1.40.0080.00317.61
8.1.30.0030.00617.72
8.1.20.0000.00817.60
8.1.10.0040.00417.49
8.1.00.0040.00417.39
8.0.300.0040.00419.85
8.0.290.0060.00316.88
8.0.280.0000.00718.54
8.0.270.0000.00817.27
8.0.260.0000.00617.36
8.0.250.0040.00417.12
8.0.240.0000.00717.09
8.0.230.0030.00317.16
8.0.220.0080.00017.09
8.0.210.0000.00717.13
8.0.200.0000.00817.11
8.0.190.0030.00317.14
8.0.180.0000.00717.13
8.0.170.0060.00317.04
8.0.160.0070.00017.05
8.0.150.0040.00417.00
8.0.140.0030.00516.93
8.0.130.0000.00613.58
8.0.120.0080.00017.04
8.0.110.0070.00316.93
8.0.100.0040.00416.96
8.0.90.0000.00717.14
8.0.80.0060.00916.98
8.0.70.0050.00316.95
8.0.60.0050.00316.87
8.0.50.0040.00417.14
8.0.30.0100.00917.28
8.0.20.0090.01217.40
8.0.10.0000.00716.96
8.0.00.0070.01016.94
7.4.330.0020.00215.08
7.4.320.0060.00016.56
7.4.300.0030.00316.56
7.4.290.0080.00016.54
7.4.280.0000.00816.66
7.4.270.0000.00716.70
7.4.260.0030.00516.55
7.4.250.0020.00516.62
7.4.240.0000.00816.46
7.4.230.0030.00316.73
7.4.220.0090.00916.74
7.4.210.0050.01016.63
7.4.200.0020.00516.72
7.4.160.0040.01116.61
7.4.150.0030.01517.40
7.4.140.0110.00717.86
7.4.130.0090.01216.67
7.4.120.0080.01016.54
7.4.110.0060.01216.60
7.4.100.0070.01016.63
7.4.90.0070.01216.70
7.4.80.0040.01419.39
7.4.70.0030.01816.80
7.4.60.0130.00316.63
7.4.50.0000.01716.45
7.4.40.0030.01316.54
7.4.30.0100.00716.67
7.4.10.0000.01814.97
7.4.00.0070.01115.20
7.3.330.0020.00213.48
7.3.320.0050.00013.30
7.3.310.0060.00316.56
7.3.300.0030.00316.55
7.3.290.0000.00716.59
7.3.280.0100.00816.55
7.3.270.0210.01317.40
7.3.260.0120.00816.63
7.3.250.0120.00516.57
7.3.240.0090.00916.60
7.3.230.0160.00316.51
7.3.210.0170.00716.43
7.3.200.0130.00616.63
7.3.190.0070.01416.50
7.3.180.0180.00416.55
7.3.170.0130.00916.67
7.3.160.0160.03216.68
7.3.130.0060.01014.84
7.3.120.0070.01014.98
7.3.110.0100.01014.90
7.3.100.0100.00715.15
7.3.90.0030.00714.88
7.3.80.0000.01214.69
7.3.70.0130.00315.00
7.3.60.0120.00614.77
7.3.50.0030.00514.94
7.3.40.0030.01415.00
7.3.30.0110.00414.93
7.3.20.0040.01116.77
7.3.10.0120.00316.75
7.3.00.0030.01416.88
7.2.330.0100.01016.83
7.2.320.0160.00616.85
7.2.310.0100.01016.91
7.2.300.0100.01316.72
7.2.290.0080.00816.61
7.2.260.0030.01615.35
7.2.250.0110.00715.34
7.2.240.0060.00915.24
7.2.230.0090.00615.05
7.2.220.0000.01015.08
7.2.210.0060.00315.14
7.2.200.0060.00914.89
7.2.190.0000.01815.09
7.2.180.0030.00615.07
7.2.170.0070.00715.23
7.2.160.0030.01015.02
7.2.150.0070.00716.93
7.2.140.0090.00616.77
7.2.130.0040.00817.02
7.2.120.0040.01117.07
7.2.110.0070.01016.99
7.2.100.0100.00716.70
7.2.90.0000.01117.02
7.2.80.0030.01616.78
7.2.70.0060.00917.01
7.2.60.0060.00916.73
7.2.50.0030.01616.82
7.2.40.0030.01316.95
7.2.30.0100.00616.77
7.2.20.0070.01116.75
7.2.10.0110.00316.79
7.2.00.0040.01117.07
7.1.330.0090.00615.78
7.1.320.0060.00315.99
7.1.310.0120.00615.76
7.1.300.0060.00615.84
7.1.290.0030.01315.71
7.1.280.0040.00715.59
7.1.270.0030.01016.02
7.1.260.0090.00615.86
7.1.250.0060.00615.52
7.1.240.0000.01115.64
7.1.230.0000.01115.66
7.1.220.0060.00915.95
7.1.210.0000.01615.84
7.1.200.0090.00615.59
7.1.190.0040.01115.96
7.1.180.0070.00415.64
7.1.170.0070.00715.77
7.1.160.0070.00715.62
7.1.150.0000.01115.86
7.1.140.0070.00715.60
7.1.130.0080.00515.91
7.1.120.0030.00915.77
7.1.110.0120.00416.06
7.1.100.0090.00915.91
7.1.90.0060.00615.79
7.1.80.0060.00315.73
7.1.70.0120.00315.93
7.1.60.0060.00315.82
7.1.50.0070.00315.96
7.1.40.0070.00715.99
7.1.30.0040.01115.70
7.1.20.0090.00615.81
7.1.10.0060.00615.88
7.1.00.0050.04019.22
7.0.330.0070.00415.49
7.0.320.0040.01115.31
7.0.310.0030.01015.32
7.0.300.0040.00815.43
7.0.290.0070.00715.52
7.0.280.0030.01015.53
7.0.270.0070.00715.44
7.0.260.0040.01115.63
7.0.250.0040.01215.52
7.0.240.0100.00315.29
7.0.230.0040.00415.59
7.0.220.0030.00915.16
7.0.210.0070.00715.36
7.0.200.0120.00315.48
7.0.190.0040.00815.59
7.0.180.0080.00315.52
7.0.170.0130.00015.59
7.0.160.0000.01415.54
7.0.150.0000.01315.47
7.0.140.0060.00615.28
7.0.130.0110.00415.35
7.0.120.0040.00415.37
7.0.110.0040.00415.61
7.0.100.0110.00315.52
7.0.90.0040.01115.47
7.0.80.0040.01215.39
7.0.70.0000.01215.43
7.0.60.0030.01015.45
7.0.50.0030.00915.38
7.0.40.0090.00913.42
7.0.30.0030.01113.43
7.0.20.0070.00313.60
7.0.10.0050.00313.61
7.0.00.0000.01013.43
5.6.400.0100.00314.41
5.6.390.0130.00014.62
5.6.380.0130.00314.41
5.6.370.0040.00714.61
5.6.360.0060.00614.63
5.6.350.0090.00614.44
5.6.340.0060.00914.60
5.6.330.0090.00614.13
5.6.320.0100.00314.52
5.6.310.0100.00614.77
5.6.300.0080.00514.32
5.6.290.0060.00614.52
5.6.280.0060.00914.62
5.6.270.0000.01014.71
5.6.260.0090.00614.68
5.6.250.0060.00914.28
5.6.240.0090.00614.52
5.6.230.0060.00614.20
5.6.220.0100.00714.50
5.6.210.0100.00714.41
5.6.200.0030.00614.38
5.6.190.0070.00714.48
5.6.180.0070.00714.65
5.6.170.0090.00314.36
5.6.160.0030.00714.36
5.6.150.0040.00814.37
5.6.140.0000.01314.37
5.6.130.0140.00314.18
5.6.120.0110.00314.59
5.6.110.0090.00314.63
5.6.100.0030.01014.47
5.6.90.0060.00614.19
5.6.80.0080.00814.23
5.6.70.0040.01214.25
5.6.60.0060.00614.52
5.6.50.0040.01114.48
5.6.40.0050.00514.23
5.6.30.0080.00314.31
5.6.20.0060.00614.13
5.6.10.0090.00614.15
5.6.00.0120.00314.34

preferences:
47.89 ms | 401 KiB | 5 Q