3v4l.org

run code in 300+ PHP versions simultaneously
<?php //INCLUDE YOUR LIST OF TWEETS AS AN ARRAY SIMILAR TO THE FOLLOWING $tweets = array( "524980794709016576", "524980794503495680", "524980792699940864" ); define('CONSUMER_KEY', "sHKRfEvXFJ3Avr3OWbkdIhkjV"); define('CONSUMER_SECRET', "HmNw6VbkFVHGObjCzYOqynz9V8NdIYlgnRcJ8K2sclLnD44dUv"); $x = base64_encode(rawurlencode(CONSUMER_KEY). ":".rawurlencode(CONSUMER_SECRET)); $url = "https://api.twitter.com/oauth2/token"; $opts = array( 'http'=>array( 'method'=>"POST", 'header'=>"Authorization:Basic $x\r\n". "Content-Type: application/x-www-form-urlencoded;charset=UTF-8.", 'content'=>"grant_type=client_credentials" ) ); $context = stream_context_create($opts); $output = file_get_contents($url,false,$context); $result = json_decode($output,true); $access_token = $result['access_token']; $query = urlencode("alibaba"); //include your query $search_url = "https://api.twitter.com/1.1/search/tweets.json?q=$query&result_type=recent&count=10"; $output = file_get_contents($search_url,false,stream_context_create(array( 'http'=>array( 'method'=>"GET", 'header'=>"Authorization:Bearer $access_token")))); $results = json_decode($output,true); //results returned as JSON $results = $results['statuses']; $c= 0; foreach ($results as $result) { $id = $result['id_str']; print $id; print "!!!"; $RTCount = $result['retweet_count']; if ($RTCount > 0) { $RTid = $result['retweeted_status']['id_str']; $tweet_url = "https://api.twitter.com/1.1/statuses/retweets/$RTid.json?count=1"; $output = file_get_contents($tweet_url,false,stream_context_create(array( 'http'=>array( 'method'=>"GET", 'header'=>"Authorization:Bearer $access_token")))); $retweets = json_decode($output,true); //results returned as JSON $last_RT = $retweets[0]['retweet_count']; } else { $last_RT = "!!!"; } //print "$tw\t$id\t$RTCount\t$last_RT\n"; } ?>

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.0170.00318.34
8.3.50.0090.00918.05
8.3.40.0070.00718.77
8.3.30.0150.00719.21
8.3.20.0030.00620.16
8.3.10.0080.00023.35
8.3.00.0030.00619.25
8.2.180.0110.00717.00
8.2.170.0120.00922.96
8.2.160.0150.00320.49
8.2.150.0180.00024.18
8.2.140.0030.00524.66
8.2.130.0050.00326.16
8.2.120.0080.00022.23
8.2.110.0100.00020.33
8.2.100.0030.00918.04
8.2.90.0050.00318.28
8.2.80.0050.00317.97
8.2.70.0000.00817.63
8.2.60.0040.00817.92
8.2.50.0060.00318.07
8.2.40.0030.00619.95
8.2.30.0000.00718.04
8.2.20.0040.00417.79
8.2.10.0040.00418.12
8.2.00.0040.00417.84
8.1.280.0070.00725.92
8.1.270.0060.00322.10
8.1.260.0110.00726.35
8.1.250.0070.00028.09
8.1.240.0060.00322.22
8.1.230.0040.00820.92
8.1.220.0080.00017.77
8.1.210.0060.00319.03
8.1.200.0030.00717.23
8.1.190.0060.00317.36
8.1.180.0030.00518.10
8.1.170.0030.00618.46
8.1.160.0040.00421.98
8.1.150.0040.00418.94
8.1.140.0060.00317.52
8.1.130.0000.00717.88
8.1.120.0000.00717.54
8.1.110.0030.00517.38
8.1.100.0040.00417.55
8.1.90.0080.00017.46
8.1.80.0080.00017.53
8.1.70.0030.00617.46
8.1.60.0040.00417.68
8.1.50.0050.00317.56
8.1.40.0040.00417.54
8.1.30.0000.00817.61
8.1.20.0080.00017.68
8.1.10.0000.00817.59
8.1.00.0040.00417.44
8.0.300.0000.00720.24
8.0.290.0040.00416.75
8.0.280.0000.00818.59
8.0.270.0070.00017.29
8.0.260.0030.00317.28
8.0.250.0000.00817.09
8.0.240.0040.00417.01
8.0.230.0070.00017.12
8.0.220.0000.00717.10
8.0.210.0030.00317.02
8.0.200.0000.00717.10
8.0.190.0040.00417.11
8.0.180.0040.00417.11
8.0.170.0000.00817.09
8.0.160.0000.00717.02
8.0.150.0050.00216.97
8.0.140.0040.00416.90
8.0.130.0000.00613.48
8.0.120.0000.00716.96
8.0.110.0040.00417.11
8.0.100.0060.00316.96
8.0.90.0080.00017.07
8.0.80.0030.01517.09
8.0.70.0040.00417.11
8.0.60.0000.00716.93
8.0.50.0040.00416.96
8.0.30.0160.01217.18
8.0.20.0140.01017.42
8.0.10.0000.00717.08
8.0.00.0090.00916.89
7.4.330.0000.00515.00
7.4.320.0030.00316.66
7.4.300.0030.00316.55
7.4.290.0070.00016.57
7.4.280.0040.00716.49
7.4.270.0050.00316.68
7.4.260.0000.00716.56
7.4.250.0040.00416.38
7.4.240.0020.00516.62
7.4.230.0000.00916.55
7.4.220.0060.01316.61
7.4.210.0000.01516.55
7.4.200.0000.00716.68
7.4.160.0130.00316.46
7.4.150.0080.01117.40
7.4.140.0110.01517.86
7.4.130.0080.01116.50
7.4.120.0100.01216.63
7.4.110.0030.01516.63
7.4.100.0040.01316.52
7.4.90.0140.00316.38
7.4.80.0080.01019.39
7.4.70.0160.00016.61
7.4.60.0130.00316.59
7.4.50.0030.00316.74
7.4.40.0000.01716.58
7.4.30.0100.00616.52
7.4.10.0090.00915.13
7.4.00.0040.01115.08
7.3.330.0000.00513.43
7.3.320.0060.00013.42
7.3.310.0030.00316.56
7.3.300.0070.00016.52
7.3.290.0110.00716.55
7.3.280.0070.00916.52
7.3.270.0190.00417.40
7.3.260.0120.00616.42
7.3.250.0090.00816.61
7.3.240.0070.01416.46
7.3.230.0190.00316.50
7.3.210.0090.00916.77
7.3.200.0070.01119.39
7.3.190.0110.01116.54
7.3.180.0030.01716.59
7.3.170.0060.01516.68
7.3.160.0100.00616.50
7.3.130.0070.01314.71
7.3.120.0070.00715.06
7.3.110.0110.00815.00
7.3.100.0110.00415.15
7.3.90.0100.00614.99
7.3.80.0030.00714.80
7.3.70.0070.00714.57
7.3.60.0060.01014.96
7.3.50.0090.00614.71
7.3.40.0040.01115.03
7.3.30.0000.01314.71
7.3.20.0090.00616.70
7.3.10.0100.00716.68
7.3.00.0050.00816.64
7.2.330.0110.00616.82
7.2.320.0070.01216.68
7.2.310.0060.01016.98
7.2.300.0060.01116.67
7.2.290.0100.01016.54
7.2.260.0060.01214.87
7.2.250.0110.00714.70
7.2.240.0060.00915.22
7.2.230.0000.01415.34
7.2.220.0030.00915.36
7.2.210.0030.01315.38
7.2.200.0060.00315.33
7.2.190.0000.01515.09
7.2.180.0120.00315.09
7.2.170.0080.00415.16
7.2.160.0040.00715.19
7.2.150.0060.01016.86
7.2.140.0000.02116.81
7.2.130.0060.00616.97
7.2.120.0050.00716.93
7.2.110.0020.00916.76
7.2.100.0060.00916.97
7.2.90.0020.01317.07
7.2.80.0060.01017.06
7.2.70.0040.01416.88
7.2.60.0080.00816.96
7.2.50.0060.00917.14
7.2.40.0060.00817.03
7.2.30.0050.01017.06
7.2.20.0070.00917.18
7.2.10.0070.00717.06
7.2.00.0060.00817.88
7.1.330.0070.00715.71
7.1.320.0030.01115.55
7.1.310.0060.00815.88
7.1.300.0070.00715.71
7.1.290.0070.00715.84
7.1.280.0090.00615.87
7.1.270.0090.00616.04
7.1.260.0100.01015.56
7.1.250.0020.01215.89
7.1.240.0060.00615.80
7.1.230.0070.00815.88
7.1.220.0050.00715.78
7.1.210.0040.00815.86
7.1.200.0090.00515.91
7.1.190.0050.01015.99
7.1.180.0030.00715.70
7.1.170.0070.00715.84
7.1.160.0060.00815.65
7.1.150.0020.00915.85
7.1.140.0070.00715.82
7.1.130.0040.00915.78
7.1.120.0060.00715.62
7.1.110.0090.00615.88
7.1.100.0050.00916.75
7.1.90.0030.00915.78
7.1.80.0030.01215.83
7.1.70.0070.00316.41
7.1.60.0020.01217.00
7.1.50.0070.01016.32
7.1.40.0050.00915.84
7.1.30.0050.00715.77
7.1.20.0040.00915.89
7.1.10.0020.01215.89
7.1.00.0070.02918.18
7.0.330.0070.00715.43
7.0.320.0060.00615.38
7.0.310.0100.00515.46
7.0.300.0060.00615.35
7.0.290.0060.01015.33
7.0.280.0040.00915.43
7.0.270.0070.00415.44
7.0.260.0000.01315.40
7.0.250.0050.00915.52
7.0.240.0060.00515.24
7.0.230.0050.00615.35
7.0.220.0070.00615.47
7.0.210.0020.01215.37
7.0.200.0060.00516.10
7.0.190.0050.00615.41
7.0.180.0110.00315.47
7.0.170.0040.00715.55
7.0.160.0020.00815.32
7.0.150.0030.00715.41
7.0.140.0060.03017.80
7.0.130.0040.00815.64
7.0.120.0100.00215.62
7.0.110.0090.00115.36
7.0.100.0050.00615.37
7.0.90.0080.00615.53
7.0.80.0020.01115.49
7.0.70.0050.00415.43
7.0.60.0050.02617.08
7.0.50.0050.03416.59
7.0.40.0060.03215.74
7.0.30.0110.02615.84
7.0.20.0100.03315.83
7.0.10.0050.02015.84
7.0.00.0070.03015.78
5.6.400.0030.00914.58
5.6.390.0070.01014.55
5.6.380.0030.00914.54
5.6.370.0020.01314.47
5.6.360.0020.01014.25
5.6.350.0050.00814.57
5.6.340.0070.00814.47
5.6.330.0070.00714.45
5.6.320.0050.00514.41
5.6.310.0030.00914.69
5.6.300.0030.01014.29
5.6.290.0070.00814.42
5.6.280.0070.00914.56
5.6.270.0100.00314.53
5.6.260.0030.01014.40
5.6.250.0020.01114.49
5.6.240.0040.00914.50
5.6.230.0120.00314.35
5.6.220.0050.00914.34
5.6.210.0060.03216.75
5.6.200.0100.03015.75
5.6.190.0030.02516.76
5.6.180.1200.02016.54
5.6.170.0140.02716.47
5.6.160.0060.02316.71
5.6.150.0060.02315.78
5.6.140.0020.02115.78
5.6.130.0070.02815.77
5.6.120.0100.03016.76
5.6.110.0080.03416.69
5.6.100.0060.01916.75
5.6.90.0210.02116.80
5.6.80.0060.02216.40
5.6.70.1440.02116.44
5.6.60.0020.00914.47
5.6.50.0090.00814.17
5.6.40.0050.00714.61
5.6.30.0030.01114.46
5.6.20.0070.00614.21
5.6.10.0010.01114.39
5.6.00.0070.00814.34
5.5.380.0070.00812.89
5.5.370.0060.00512.59
5.5.360.0040.00912.63
5.5.350.0060.03215.46
5.5.340.0040.02614.46
5.5.330.0050.03015.55
5.5.320.0090.03415.40
5.5.310.0090.03115.37
5.5.300.0040.02914.64
5.5.290.0060.02014.42
5.5.280.0060.03215.47
5.5.270.0050.02515.53
5.5.260.0100.02015.56
5.5.250.0040.01815.43
5.5.240.0140.02615.31
5.5.230.0060.00712.61
5.5.220.0020.00812.57
5.5.210.0070.00712.78
5.5.200.0070.00512.71
5.5.190.0030.00712.58
5.5.180.0070.00412.73
5.5.170.0060.00712.81
5.5.160.0050.00812.61
5.5.150.0060.00512.64
5.5.140.0030.00812.79
5.5.130.0040.00712.56
5.5.120.0030.00912.58
5.5.110.0050.00812.83
5.5.100.0090.00512.63
5.5.90.0070.00312.55
5.5.80.0060.00612.67
5.5.70.0050.00712.71
5.5.60.0050.00512.75
5.5.50.0070.00712.67
5.5.40.0040.00712.74
5.5.30.0040.00812.62
5.5.20.0080.00512.62
5.5.10.0050.00512.54
5.5.00.0020.01112.76
5.4.450.0280.02214.51
5.4.440.0280.02614.52
5.4.430.0400.02714.60
5.4.420.0270.00314.51
5.4.410.0260.00214.51
5.4.400.0220.00614.28
5.4.390.0310.00314.30
5.4.380.0260.00314.31
5.4.370.0310.00514.45
5.4.360.0240.00414.31
5.4.350.0240.00514.37
5.4.340.0070.01311.94
5.4.330.0020.00911.90
5.4.320.0030.02012.10
5.4.310.0060.01412.08
5.4.300.0030.01812.10
5.4.290.0080.01512.13
5.4.280.0040.01612.01
5.4.270.0060.01812.03
5.4.260.0040.01812.10
5.4.250.0050.01712.06
5.4.240.0020.02012.01
5.4.230.0060.01712.01
5.4.220.0060.01612.06
5.4.210.0050.01512.00
5.4.200.0040.01911.95
5.4.190.0050.01611.99
5.4.180.0080.01211.93
5.4.170.0040.01612.08
5.4.160.0080.01711.96
5.4.150.0040.01712.00
5.4.140.0060.01711.90
5.4.130.0040.01711.89
5.4.120.0040.01711.90
5.4.110.0040.01611.85
5.4.100.0030.01811.86
5.4.90.0050.01611.92
5.4.80.0040.01711.95
5.4.70.0060.01711.98
5.4.60.0050.01511.99
5.4.50.0080.01411.93
5.4.40.0040.01711.82
5.4.30.0050.01811.94
5.4.20.0030.01811.90
5.4.10.0030.02211.95
5.4.00.0050.01611.79
5.3.290.0060.02511.71
5.3.280.0050.02211.58
5.3.270.0050.02111.67
5.3.260.0020.02311.62
5.3.250.0020.02511.68
5.3.240.0040.02211.61
5.3.230.0080.02311.52
5.3.220.0070.02011.45
5.3.210.0080.02111.54
5.3.200.0030.02211.57
5.3.190.0060.02311.54
5.3.180.0040.02011.66
5.3.170.0070.01911.70
5.3.160.0030.02411.70
5.3.150.0020.02311.66
5.3.140.0050.02211.62
5.3.130.0040.02311.61
5.3.120.0030.02511.53
5.3.110.0040.02111.60
5.3.100.0050.02211.26
5.3.90.0070.01911.35
5.3.80.0030.02211.30
5.3.70.0020.02611.24
5.3.60.0040.02111.15
5.3.50.0050.02111.28
5.3.40.0050.02011.27
5.3.30.0060.02111.23
5.3.20.0050.02111.02
5.3.10.0020.02210.97
5.3.00.0060.02010.98
5.2.170.0020.0189.28
5.2.160.0060.0149.35
5.2.150.0040.0189.34
5.2.140.0040.0189.38
5.2.130.0030.0189.34
5.2.120.0050.0179.23
5.2.110.0020.0209.38
5.2.100.0060.0149.36
5.2.90.0040.0189.34
5.2.80.0050.0169.31
5.2.70.0060.0159.37
5.2.60.0020.0209.27
5.2.50.0050.0229.19
5.2.40.0050.0189.20
5.2.30.0040.0179.21
5.2.20.0040.0199.24
5.2.10.0060.0159.15
5.2.00.0030.0169.06
5.1.60.0050.0148.70
5.1.50.0030.0168.70
5.1.40.0020.0178.69
5.1.30.0030.0158.87
5.1.20.0040.0158.88
5.1.10.0020.0178.74
5.1.00.0040.0168.74
5.0.50.0040.0147.98
5.0.40.0050.0117.91
5.0.30.0020.0197.81
5.0.20.0060.0127.80
5.0.10.0020.0147.79
5.0.00.0050.0167.79
4.4.90.0020.0137.03
4.4.80.0040.0127.02
4.4.70.0020.0107.03
4.4.60.0020.0087.02
4.4.50.0020.0117.03
4.4.40.0010.0167.00
4.4.30.0020.0137.03
4.4.20.0020.0137.07
4.4.10.0040.0107.07
4.4.00.0040.0147.02
4.3.110.0010.0116.98
4.3.100.0030.0106.98
4.3.90.0020.0086.96
4.3.80.0040.0126.94
4.3.70.0030.0096.96
4.3.60.0030.0096.96
4.3.50.0040.0086.96
4.3.40.0030.0146.91
4.3.30.0000.0126.31
4.3.20.0010.0116.30
4.3.10.0020.0096.28
4.3.00.0100.0118.25

preferences:
56.82 ms | 400 KiB | 5 Q