3v4l.org

run code in 300+ PHP versions simultaneously
<?php class instagram_story{ protected function file_get_contents_curl($url){ $cookies = dirname(__FILE__)."/auth.txt" ; $curl = curl_init(); curl_setopt ($curl, CURLOPT_URL, $url); curl_setopt ($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt ($curl, CURLOPT_COOKIEFILE, $cookies); curl_setopt ($curl, CURLOPT_RETURNTRANSFER, true); $answer = curl_exec($curl); curl_close($curl); return $answer; } public function getStory($username){ $url = file_get_contents("https://www.instagram.com/$username/"); $json = '/sharedData\s=\s(.*[^\"]);<.script>/ixU'; preg_match_all($json, $url, $jsondata, PREG_SET_ORDER, 0); $array = json_decode($jsondata[0][1], true); $user_id = $array['entry_data']['ProfilePage']['0']['graphql']['user']['id']; $stories = $this->file_get_contents_curl("https://www.instagram.com/graphql/query/?query_hash=de8017ee0a7c9c45ec4260733d81ea31&variables=%7B%22reel_ids%22%3A%5B%22$user_id%22%5D%2C%22tag_names%22%3A%5B%5D%2C%22location_ids%22%3A%5B%5D%2C%22highlight_reel_ids%22%3A%5B%5D%2C%22precomposed_overlay%22%3Afalse%2C%22show_story_viewer_list%22%3Atrue%2C%22story_viewer_fetch_count%22%3A50%2C%22story_viewer_cursor%22%3A%22%22%7D"); $data = json_decode($stories, true); $stories = $data['data']['reels_media']['0']['items']; $_story = []; foreach ($stories as $story) { $vid = 'video_resources'; if (!array_key_exists($vid, $story)) { $_story [] = $story['display_url']; } else { $_story [] = $story['video_resources'][0]['src']; } } foreach ($_story as $story) { $check = '/mp4/m'; preg_match_all($check, $story, $matches, PREG_SET_ORDER, 0); if (empty($matches)) { echo "<a href=$story&dl=1><img src=$story></a>"; } else { echo '<video width="320" height="240" controls>'; echo '<source src="' . $story . '" type="video/mp4">'; echo '</video>'; echo "<a href=$story&dl=1>Download</a>"; } } } } // require_once 'class.instagram.php'; if (isset($_POST['submit'])) { $story = new instagram_story(); $story->getStory($_POST['username']); } ?> <div id="center" style="text-align: center; margin-top: 300px;"> <form action="http://storiesnab.com/page/loadmedia" method="post"> <input name="username"> <input type="submit" name="submit"> </form> </div>

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.00316.75
8.3.50.0080.00818.23
8.3.40.0120.00318.44
8.3.30.0130.01018.67
8.3.20.0040.00420.89
8.3.10.0040.00421.81
8.3.00.0000.00820.69
8.2.180.0120.00918.34
8.2.170.0120.00622.96
8.2.160.0030.01020.36
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00426.16
8.2.110.0060.00322.25
8.2.100.0080.00417.91
8.2.90.0050.00317.90
8.2.80.0040.00417.97
8.2.70.0030.00618.04
8.2.60.0050.00318.22
8.2.50.0000.00918.10
8.2.40.0030.00720.85
8.2.30.0040.00419.35
8.2.20.0040.00418.16
8.2.10.0030.00518.85
8.2.00.0080.00019.29
8.1.280.0110.00425.92
8.1.270.0030.00622.34
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0060.00321.82
8.1.230.0040.00722.67
8.1.220.0050.00320.88
8.1.210.0040.00418.77
8.1.200.0030.00617.22
8.1.190.0000.00817.23
8.1.180.0000.01018.10
8.1.170.0040.00418.66
8.1.160.0000.00720.24
8.1.150.0000.00818.86
8.1.140.0040.00418.82
8.1.130.0030.00320.23
8.1.120.0000.00717.27
8.1.110.0080.00017.46
8.1.100.0040.00417.32
8.1.90.0000.00717.42
8.1.80.0040.00417.34
8.1.70.0030.00317.43
8.1.60.0030.00517.55
8.1.50.0030.00617.50
8.1.40.0000.00817.48
8.1.30.0000.00817.63
8.1.20.0030.00517.57
8.1.10.0080.00017.56
8.1.00.0040.00417.45
8.0.300.0060.00322.07
8.0.290.0040.00416.63
8.0.280.0030.00318.41
8.0.270.0040.00417.32
8.0.260.0030.00320.04
8.0.250.0070.00016.90
8.0.240.0000.00716.95
8.0.230.0030.00316.80
8.0.220.0030.00316.89
8.0.210.0000.00716.89
8.0.200.0000.00816.92
8.0.190.0050.00317.00
8.0.180.0040.00416.78
8.0.170.0030.00616.92
8.0.160.0080.00016.85
8.0.150.0050.00216.79
8.0.140.0030.00516.83
8.0.130.0000.00613.26
8.0.120.0090.00215.05
8.0.110.0080.00215.10
8.0.100.0050.00415.15
8.0.90.0090.00215.01
8.0.80.0090.00515.62
8.0.70.0090.00214.98
8.0.60.0040.00615.06
8.0.50.0060.00415.07
8.0.30.0090.00615.08
8.0.20.0100.00715.14
8.0.10.0080.00215.27
8.0.00.0050.00914.95
7.4.330.0000.00715.55
7.4.320.0060.00016.62
7.4.300.0050.00216.62
7.4.290.0080.00016.59
7.4.280.0040.00416.49
7.4.270.0030.00316.40
7.4.260.0050.00013.27
7.4.250.0050.00214.80
7.4.240.0030.00515.40
7.4.230.0080.00314.81
7.4.220.0040.00515.40
7.4.210.0100.00615.72
7.4.200.0020.00614.77
7.4.190.0000.00613.40
7.4.180.0040.00413.34
7.4.160.0000.00613.32
7.4.150.0000.00613.22
7.4.140.0060.00013.20
7.4.130.0050.00614.87
7.4.120.0070.00514.77
7.4.110.0050.00614.89
7.4.100.0030.00914.84
7.4.90.0050.00814.78
7.4.80.0090.00616.29
7.4.70.0060.00814.83
7.4.60.0070.00514.75
7.4.50.0050.00714.88
7.4.40.0060.00614.82
7.4.30.0080.00013.18
7.4.20.0070.00013.10
7.4.10.0120.00013.20
7.4.00.0060.00814.25
7.3.330.0000.00716.17
7.3.320.0040.00413.04
7.3.310.0010.00514.75
7.3.300.0050.00214.64
7.3.290.0100.00415.49
7.3.280.0090.00614.77
7.3.270.0110.00313.01
7.3.260.0100.00514.77
7.3.250.0120.00013.21
7.3.240.0090.00715.76
7.3.230.0090.00514.82
7.3.220.0120.00012.93
7.3.210.0100.00514.49
7.3.200.0030.00914.65
7.3.190.0100.00514.67
7.3.180.0090.00614.64
7.3.170.0100.00514.52
7.3.160.0090.00314.66
7.3.150.0070.00813.11
7.3.140.0130.00012.89
7.3.130.0080.00313.05
7.3.120.0100.00614.21
7.3.110.0100.00814.46
7.3.100.0100.00514.41
7.3.90.0060.00914.33
7.3.80.0060.00614.46
7.3.70.0060.00814.41
7.3.60.0060.00814.41
7.3.50.0090.00514.36
7.3.40.0070.00814.33
7.3.30.0090.00614.33
7.3.20.0070.00615.15
7.3.10.0060.00815.07
7.3.00.0090.00715.05
7.2.340.0110.00413.29
7.2.330.0060.01115.06
7.2.320.0090.01015.05
7.2.310.0050.01014.96
7.2.300.0110.00814.93
7.2.290.0060.01014.98
7.2.280.0110.00313.33
7.2.270.0100.00513.07
7.2.260.0080.00813.24
7.2.250.0120.00414.20
7.2.240.0100.00614.53
7.2.230.0100.00714.60
7.2.220.0070.00714.66
7.2.210.0100.00414.49
7.2.200.0080.00714.58
7.2.190.0090.00714.55
7.2.180.0070.00714.64
7.2.170.0050.01114.66
7.2.160.0090.00714.54
7.2.150.0100.00515.06
7.2.140.0100.00615.08
7.2.130.0080.00715.10
7.2.120.0090.00815.09
7.2.110.0080.00815.16
7.2.100.0090.00715.11
7.2.90.0090.00615.13
7.2.80.0090.00915.15
7.2.70.0090.00715.11
7.2.60.0100.00714.91
7.2.50.0110.00515.05
7.2.40.0120.00815.11
7.2.30.0130.00915.10
7.2.20.0090.00915.07
7.2.10.0090.01015.14
7.2.00.0040.01315.06
7.1.330.0120.00414.38
7.1.320.0050.01214.22
7.1.310.0090.00614.23
7.1.300.0080.00614.18
7.1.290.0080.00714.17
7.1.280.0070.00714.26
7.1.270.0090.00414.29
7.1.260.0070.00614.36
7.1.250.0090.00613.91
7.1.240.0120.00313.96
7.1.230.0110.00314.02
7.1.220.0100.00814.13
7.1.210.0060.00913.96
7.1.200.0100.00514.00
7.1.190.0110.00413.85
7.1.180.0100.00513.70
7.1.170.0110.00513.99
7.1.160.0120.00413.71
7.1.150.0110.00413.82
7.1.140.0090.00713.80
7.1.130.0070.00913.76
7.1.120.0040.01113.89
7.1.110.0150.00213.85
7.1.100.0110.00413.77
7.1.90.0040.00913.75
7.1.80.0080.00513.88
7.1.70.0110.00613.91
7.1.60.0130.00313.85
7.1.50.0110.00714.01
7.1.40.0210.00614.10
7.1.30.0050.01013.82
7.1.20.0060.01013.84
7.1.10.0060.00913.87
7.1.00.0210.00613.74
7.0.330.0090.00513.64
7.0.320.0150.00513.57
7.0.310.0130.00313.81
7.0.300.0090.00413.79
7.0.290.0110.00513.67
7.0.280.0170.00413.71
7.0.270.0120.00713.55
7.0.260.0120.00713.64
7.0.250.0100.00613.86
7.0.240.0160.00213.84
7.0.230.0100.00613.84
7.0.220.0110.00513.92
7.0.210.0120.00313.78
7.0.200.0140.00413.72
7.0.190.0150.00413.88
7.0.180.0110.00713.87
7.0.170.0090.00813.96
7.0.160.0130.00513.80
7.0.150.0120.00813.64
7.0.140.0100.00613.83
7.0.130.0080.00813.79
7.0.120.0150.00613.84
7.0.110.0080.00613.79
7.0.100.0120.00213.81
7.0.90.0100.00313.67
7.0.80.0100.00313.75
7.0.70.0040.00913.69
7.0.60.0140.00013.71
7.0.50.0090.00413.79
7.0.40.0080.00413.85
7.0.30.0090.00713.90
7.0.20.0090.00513.69
7.0.10.0070.00513.69
7.0.00.0050.00813.66
5.6.400.0100.00513.48
5.6.390.0090.00713.47
5.6.380.0060.00913.57
5.6.370.0140.00413.71
5.6.360.0100.00813.53
5.6.350.0130.00613.58
5.6.340.0130.00613.40
5.6.330.0120.00613.46
5.6.320.0080.00913.36
5.6.310.0150.00313.47
5.6.300.0150.00113.32
5.6.290.0060.00813.36
5.6.280.0110.00713.44
5.6.270.0110.00713.35
5.6.260.0060.00813.44
5.6.250.0120.00313.42
5.6.240.0060.00713.56
5.6.230.0090.00313.48
5.6.220.0090.00513.52
5.6.210.0100.00513.65
5.6.200.0070.00613.61
5.6.190.0080.00513.57
5.6.180.0080.00613.70
5.6.170.0030.01113.52
5.6.160.0130.00313.60
5.6.150.0120.00413.56
5.6.140.0090.00513.68
5.6.130.0090.00713.53
5.6.120.0110.00513.66
5.6.110.0110.00513.72
5.6.100.0090.00813.45
5.6.90.0130.00213.45
5.6.80.0030.01013.55
5.6.70.0110.00713.54
5.6.60.0100.00813.47
5.6.50.0090.00713.38
5.6.40.0080.00813.39
5.6.30.0110.00413.37
5.6.20.0090.00713.43
5.6.10.0140.00413.36
5.6.00.0110.00713.41
5.5.380.0080.00713.48
5.5.370.0120.00413.56
5.5.360.0080.01113.24
5.5.350.0070.00613.35
5.5.340.0080.00613.61
5.5.330.0080.00613.45
5.5.320.0110.00513.43
5.5.310.0070.00913.46
5.5.300.0080.00913.37
5.5.290.0100.00513.44
5.5.280.0110.00613.40
5.5.270.0060.00813.23
5.5.260.0090.00613.17
5.5.250.0070.00713.54
5.5.240.0100.00413.25
5.5.230.0090.00613.35
5.5.220.0030.01013.27
5.5.210.0100.00413.54
5.5.200.0060.01013.19
5.5.190.0140.01313.32
5.5.180.0030.01213.24
5.5.170.0060.00813.26
5.5.160.0070.00713.39
5.5.150.0080.00613.38
5.5.140.0080.00513.13
5.5.130.0090.00513.32
5.5.120.0100.00513.22
5.5.110.0120.00413.27
5.5.100.0070.00713.47
5.5.90.0090.00413.22
5.5.80.0120.00513.14
5.5.70.0140.00313.40
5.5.60.0070.01113.14
5.5.50.0070.00813.45
5.5.40.0080.00613.36
5.5.30.0100.00513.52
5.5.20.0100.00413.42
5.5.10.0070.00613.33
5.5.00.0050.01013.36
5.4.450.0030.01011.95
5.4.440.0040.00811.87
5.4.430.0110.00311.73
5.4.420.0080.00411.75
5.4.410.0090.00211.74
5.4.400.0070.00611.64
5.4.390.0080.00511.69
5.4.380.0100.00511.74
5.4.370.0100.00411.55
5.4.360.0090.00611.63
5.4.350.0130.00211.81
5.4.340.0000.01211.56
5.4.330.0100.00411.78
5.4.320.0050.01011.60
5.4.310.0080.00511.62
5.4.300.0120.00011.63
5.4.290.0130.00211.65
5.4.280.0080.00511.65
5.4.270.0050.00711.62
5.4.260.0130.00211.85
5.4.250.0070.00711.70
5.4.240.0060.00711.66
5.4.230.0100.00511.54
5.4.220.0080.00511.71
5.4.210.0090.00411.45
5.4.200.0100.00211.61
5.4.190.0080.00611.62
5.4.180.0100.00311.73
5.4.170.0100.00311.64
5.4.160.0110.00211.66
5.4.150.0090.00311.56
5.4.140.0110.00311.62
5.4.130.0070.00611.72
5.4.120.0090.00511.72
5.4.110.0130.00011.79
5.4.100.0090.00411.80
5.4.90.0060.00711.59
5.4.80.0100.00211.73
5.4.70.0060.00611.82
5.4.60.0080.00511.72
5.4.50.0100.00111.54
5.4.40.0030.01011.64
5.4.30.0110.00211.72
5.4.20.0100.00111.70
5.4.10.0060.00611.82
5.4.00.0050.00711.79
5.3.290.0090.00711.69
5.3.280.0090.00511.73
5.3.270.0100.00311.66
5.3.260.0070.00511.68
5.3.250.0060.00611.63
5.3.240.0070.00811.60
5.3.230.0080.00511.63
5.3.220.0110.00111.73
5.3.210.0080.00511.63
5.3.200.0070.00711.63
5.3.190.0070.00611.66
5.3.180.0110.00411.86
5.3.170.0100.00411.72
5.3.160.0070.00711.86
5.3.150.0120.00311.86
5.3.140.0090.00411.78
5.3.130.0120.00111.82
5.3.120.0090.00311.79
5.3.110.0120.00111.83
5.3.100.0100.00311.65
5.3.90.0110.00111.82
5.3.80.0080.00311.71
5.3.70.0080.00411.77
5.3.60.0100.00311.68
5.3.50.0100.00311.66
5.3.40.0100.00211.66
5.3.30.0050.00711.75
5.3.20.0080.00411.73
5.3.10.0100.00211.64
5.3.00.0100.00211.54
5.2.170.0080.00311.17
5.2.160.0070.00311.19
5.2.150.0040.00811.31
5.2.140.0070.00311.15
5.2.130.0050.00511.26
5.2.120.0020.00911.14
5.2.110.0030.00711.16
5.2.100.0050.00511.15
5.2.90.0080.00111.14
5.2.80.0070.00311.14
5.2.70.0070.00311.17
5.2.60.0060.00411.22
5.2.50.0120.00111.16
5.2.40.0090.00111.25
5.2.30.0060.00411.21
5.2.20.0100.00011.05
5.2.10.0100.00011.01
5.2.00.0070.00311.02
5.1.60.0050.00610.83
5.1.50.0050.00510.78
5.1.40.0080.00210.75
5.1.30.0050.00410.87
5.1.20.0040.00410.74
5.1.10.0070.00410.82
5.1.00.0090.00210.65
5.0.50.0050.00310.59
5.0.40.0070.00210.59
5.0.30.0060.00210.59
5.0.20.0040.00410.59
5.0.10.0060.00210.59
5.0.00.0050.00410.59
4.4.90.0060.00110.59
4.4.80.0020.00410.59
4.4.70.0020.00310.59
4.4.60.0030.00210.59
4.4.50.0020.00310.59
4.4.40.0050.00110.59
4.4.30.0030.00410.59
4.4.20.0020.00310.59
4.4.10.0040.00210.59
4.4.00.0030.00210.59
4.3.110.0060.00010.59
4.3.100.0040.00210.59
4.3.90.0020.00410.59
4.3.80.0020.00410.59
4.3.70.0040.00210.59
4.3.60.0030.00310.59
4.3.50.0050.00010.59
4.3.40.0050.00010.59
4.3.30.0020.00310.59
4.3.20.0010.00310.59
4.3.10.0020.00210.59
4.3.00.0010.00310.59

preferences:
70.09 ms | 401 KiB | 5 Q