3v4l.org

run code in 300+ PHP versions simultaneously
<?php $current_path = 'http://www.liveinstyle.com/star-speak/the-ranveer-singh-royal-challenge-can-it-get-bolder-than-this-5656'; $social_share = array("http://graph.facebook.com/?id=", "http://cdn.api.twitter.com/1/urls/count.json?url=","http://api.pinterest.com/v1/urls/count.json?callback=jsonp&url=", "https://plusone.google.com/_/+1/fastbutton?url="); $share = 0; foreach($social_share as $social) { $url = $social. $current_path; $json_output = file_get_contents($url, TRUE); $json = json_decode($json_output, TRUE); if($social == "http://graph.facebook.com/?id="){ $share += $json['shares']; } elseif($social == "https://plusone.google.com/_/+1/fastbutton?url="){ $doc = new DOMDocument(); @$doc->loadHTML($json_output); $counter=$doc->getElementById('aggregateCount'); $share += $counter->nodue; } else{ $share += $json['count']; } } print $share;

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.0160.00017.50
8.3.50.0120.00621.25
8.3.40.0120.00419.44
8.3.30.0000.01619.20
8.3.20.0060.00320.48
8.3.10.0030.00523.98
8.3.00.0060.00322.04
8.2.180.0060.01016.75
8.2.170.0110.00422.96
8.2.160.0070.00722.33
8.2.150.0050.00524.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00418.13
8.2.110.0000.01021.33
8.2.100.0090.00318.00
8.2.90.0030.00519.60
8.2.80.0000.00818.00
8.2.70.0080.00017.75
8.2.60.0090.00018.30
8.2.50.0090.00018.07
8.2.40.0030.00621.51
8.2.30.0050.00320.04
8.2.20.0040.00417.95
8.2.10.0060.00318.29
8.2.00.0000.00818.50
8.1.280.0140.00425.92
8.1.270.0060.00320.47
8.1.260.0000.00826.35
8.1.250.0030.00528.09
8.1.240.0030.00624.07
8.1.230.0130.00017.73
8.1.220.0000.00818.16
8.1.210.0070.00318.77
8.1.200.0090.00017.73
8.1.190.0040.00417.38
8.1.180.0050.00318.10
8.1.170.0050.00318.65
8.1.160.0080.00022.38
8.1.150.0070.00019.18
8.1.140.0040.00417.75
8.1.130.0030.00618.02
8.1.120.0070.00017.71
8.1.110.0040.00417.68
8.1.100.0000.00817.64
8.1.90.0000.00717.61
8.1.80.0070.00017.62
8.1.70.0000.00717.59
8.1.60.0050.00517.80
8.1.50.0060.00317.62
8.1.40.0000.00817.75
8.1.30.0000.00817.81
8.1.20.0060.00317.89
8.1.10.0040.00417.83
8.1.00.0030.00517.67
8.0.300.0080.00018.77
8.0.290.0000.00917.13
8.0.280.0040.00418.67
8.0.270.0040.00417.59
8.0.260.0030.00317.52
8.0.250.0040.00417.35
8.0.240.0000.00717.33
8.0.230.0080.00017.34
8.0.220.0070.00017.29
8.0.210.0000.00717.22
8.0.200.0070.00017.32
8.0.190.0080.00317.22
8.0.180.0080.00017.22
8.0.170.0150.00017.31
8.0.160.0000.00717.23
8.0.150.0000.00717.28
8.0.140.0030.00517.25
8.0.130.0000.00813.83
8.0.120.0030.00617.33
8.0.110.0030.00517.24
8.0.100.0040.00417.24
8.0.90.0030.00617.47
8.0.80.0070.01017.32
8.0.70.0040.00417.27
8.0.60.0060.00317.24
8.0.50.0000.00817.48
8.0.30.0120.00817.50
8.0.20.0170.00417.53
8.0.10.0050.00317.23
8.0.00.0120.00817.09
7.4.330.0000.00715.08
7.4.320.0070.00016.84
7.4.300.0030.00316.81
7.4.290.0050.00216.77
7.4.280.0000.00716.75
7.4.270.0000.00716.79
7.4.260.0040.00416.84
7.4.250.0060.00316.98
7.4.240.0020.00616.90
7.4.230.0050.00216.93
7.4.220.0090.00916.92
7.4.210.0060.00916.94
7.4.200.0000.00817.04
7.4.160.0120.00616.88
7.4.150.0180.00417.40
7.4.140.0080.01417.86
7.4.130.0110.01616.94
7.4.120.0110.01116.85
7.4.110.0100.01016.87
7.4.100.0120.00916.92
7.4.90.0090.01616.86
7.4.80.0130.00619.39
7.4.70.0090.00916.69
7.4.60.0060.01616.87
7.4.50.0000.00916.83
7.4.40.0150.00917.04
7.4.30.0060.01817.05
7.4.00.0060.00915.04
7.3.330.0000.00713.77
7.3.320.0000.00613.61
7.3.310.0040.00416.84
7.3.300.0000.00716.59
7.3.290.0000.00716.70
7.3.280.0130.00816.73
7.3.270.0150.00717.40
7.3.260.0150.01116.63
7.3.250.0100.01216.80
7.3.240.0160.01016.92
7.3.230.0080.01216.84
7.3.210.0170.00316.90
7.3.200.0120.00616.70
7.3.190.0000.02016.63
7.3.180.0070.01016.64
7.3.170.0100.01016.59
7.3.160.0120.01216.86
7.2.330.0150.00316.97
7.2.320.0100.01016.98
7.2.310.0030.01716.88
7.2.300.0030.01416.68
7.2.290.0040.01516.84
7.2.60.0110.00417.34
7.2.00.0070.01019.63
7.1.200.0050.00516.16
7.1.100.0000.01318.63
7.1.70.0040.00417.23
7.1.60.0070.01019.18
7.1.50.0030.02117.52
7.1.00.0030.07722.65
7.0.200.0120.00316.86
7.0.60.0070.07020.19
7.0.50.0070.07718.15
7.0.40.0030.06320.64
7.0.30.0330.07720.57
7.0.20.0300.08320.56
7.0.10.0030.04320.49
7.0.00.0030.08020.48
5.6.210.0100.08021.18
5.6.200.0000.05718.57
5.6.190.0100.04721.10
5.6.180.0430.05021.04
5.6.170.0230.05020.87
5.6.160.0070.09020.82
5.6.150.0030.06718.39
5.6.140.0070.06718.44
5.6.130.0070.08318.41
5.6.120.0070.07321.25
5.6.110.0000.04721.43
5.6.100.0200.05021.24
5.6.90.0230.06721.40
5.6.80.0030.04320.73
5.5.350.0200.04320.66
5.5.340.0030.04318.36
5.5.330.0100.08020.95
5.5.320.0470.06320.75
5.5.310.0300.08020.66
5.5.300.0100.05718.40
5.5.290.0130.03018.25
5.5.280.0030.04021.40
5.5.270.0100.08021.02
5.5.260.0170.07321.24
5.5.250.0070.07321.05
5.5.240.0070.07720.70
5.4.450.0970.06019.70
5.4.440.0900.04719.55
5.4.430.0730.04719.59
5.4.420.0630.05719.74
5.4.410.0600.05719.59
5.4.400.0600.06319.24
5.4.390.0870.06019.27
5.4.380.0700.05319.39
5.4.370.0630.05319.39
5.4.360.0700.06019.52
5.4.350.0170.05319.45
5.4.340.0100.05719.37
5.4.320.0130.05319.37
5.4.310.0170.04719.41
5.4.300.0770.05319.42
5.4.290.0800.05019.30
5.4.280.0870.06019.51
5.4.270.0700.04319.48
5.4.260.0930.03719.27
5.4.250.0600.06719.45
5.4.240.0970.06319.21
5.4.230.0770.07719.27
5.4.220.0900.05719.30
5.4.210.0130.06019.34
5.4.200.0200.04317.06
5.4.190.0130.06319.36
5.4.180.0830.05319.30
5.4.170.0930.06319.36
5.4.160.0600.06319.44
5.4.150.0800.06319.35
5.4.140.0170.05716.73
5.4.130.0130.04716.81
5.4.120.0370.05016.74
5.4.110.1130.05716.68
5.4.100.1000.06716.72
5.4.90.0800.05016.60
5.4.80.0730.05716.79
5.4.70.0770.05316.63
5.4.60.0770.06316.73
5.4.50.0800.05716.62
5.4.40.0770.05316.87
5.4.30.0800.05316.62
5.4.20.0770.05316.62
5.4.10.0670.05016.61
5.4.00.0800.04716.13
5.3.290.0700.06714.73
5.3.280.0600.05714.73
5.3.270.0770.05014.81
5.3.260.0670.05714.81
5.3.250.0530.06014.89
5.3.240.0630.05314.82
5.3.230.0700.05314.86
5.3.220.1000.04314.70
5.3.210.0700.07314.84
5.3.200.0800.07014.53
5.3.190.0130.05714.70
5.3.180.0130.05314.60
5.3.170.0430.05314.64
5.3.160.0870.04714.83
5.3.150.0970.07014.59
5.3.140.1130.05014.59
5.3.130.0170.05714.70
5.3.120.0130.05314.62
5.3.110.0330.05014.75
5.3.100.0770.04014.07
5.3.90.0800.05014.22
5.3.80.0570.05713.96
5.3.70.0830.04713.97
5.3.60.0670.05014.11
5.3.50.0600.05314.12
5.3.40.0600.05313.97
5.3.30.0670.04714.10
5.3.20.0770.05013.77
5.3.10.0900.06013.86
5.3.00.0730.05313.84
5.2.170.0630.04311.11
5.2.160.0600.03311.31
5.2.150.0600.04311.41
5.2.140.0670.04011.25
5.2.130.0670.04011.36
5.2.120.0630.04011.07
5.2.110.0630.06011.30
5.2.100.0530.03711.21
5.2.90.0630.03711.06
5.2.80.0070.04311.36
5.2.70.0100.04311.15
5.2.60.0000.05011.08
5.2.50.0470.04311.21
5.2.40.0430.03711.02
5.2.30.0500.03311.11
5.2.20.0500.04710.96
5.2.10.0470.05311.05
5.2.00.0500.04310.88
5.1.60.0070.03710.01
5.1.50.0000.04010.01
5.1.40.0070.0339.92
5.1.30.0030.04010.48
5.1.20.0670.04710.47
5.1.10.0500.03710.02
5.1.00.0500.03710.18
5.0.50.0270.0338.54
5.0.40.0300.0238.38
5.0.30.0230.0438.26
5.0.20.0200.0378.25
5.0.10.0270.0278.12
5.0.00.0170.0478.24
4.4.90.0170.0276.87
4.4.80.0170.0276.87
4.4.70.0270.0176.87
4.4.60.0230.0206.87
4.4.50.0170.0236.87
4.4.40.0270.0306.87
4.4.30.0300.0306.87
4.4.20.0270.0176.87
4.4.10.0270.0176.87
4.4.00.0230.0376.87
4.3.110.0300.0276.87
4.3.100.0230.0206.87
4.3.90.0230.0276.87
4.3.80.0270.0276.87
4.3.70.0270.0276.87
4.3.60.0100.0306.87
4.3.50.0330.0236.87
4.3.40.0270.0336.87
4.3.30.0070.0206.87
4.3.20.0000.0276.87
4.3.10.0030.0236.87
4.3.00.0100.0237.26

preferences:
49.81 ms | 401 KiB | 5 Q