3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); ini_set('display_errors', 1); function run(){ $apiKey = 'demo'; $clanMembers = json_decode(getData('http://api.worldoftanks.com/wgn/clans/info/?application_id='.$apiKey.'&fields=members.account_name%2Cmembers.account_id&clan_id=1000021200'),true); $data = array(); $players = array(); foreach ($clanMembers['data']['1000021200']['members'] as $key) { $urls[] = 'http://api.worldoftanks.com/wot/globalmap/eventaccountinfo/?application_id='.$apiKey.'&fields=events.battles%2Cevents.battles_to_award%2Cevents.fame_points%2Cevents.rank&event_id=black_gold_first_step&front_id=1511_us_c4event1_front_1&account_id='.$key['account_id']; $players[] = array($key['account_name'],$key['account_id']); } $urls = array_chunk($urls, 20,true); for($i = 0;$i<5;$i++){ $data = array_merge($data,multiRequest($urls[$i])); } $data2 = array(); foreach ($data as $key => $value) { //echo $key; $data2[$players[$key][1]] = json_decode($value,true)['data'][$players[$key][1]]['events']['black_gold_first_step']; $data2[$players[$key][1]][0]['account_name'] = $players[$key][0]; $data2[$players[$key][1]][0]['account_id'] = $players[$key][1]; } print_r($data2); return $data2; } function getData($url){ $rCURL = curl_init(); curl_setopt($rCURL, CURLOPT_URL, $url); curl_setopt($rCURL, CURLOPT_HEADER, 0); curl_setopt($rCURL, CURLOPT_RETURNTRANSFER, 1); $aData = curl_exec($rCURL); curl_close($rCURL); return $aData; } function multiRequest($data, $options = array()) { // array of curl handles $curly = array(); // data to be returned $result = array(); // multi handle $mh = curl_multi_init(); // loop through $data and create curl handles // then add them to the multi-handle foreach ($data as $id => $d) { $curly[$id] = curl_init(); $url = (is_array($d) && !empty($d['url'])) ? $d['url'] : $d; curl_setopt($curly[$id], CURLOPT_URL, $url); curl_setopt($curly[$id], CURLOPT_HEADER, 0); curl_setopt($curly[$id], CURLOPT_RETURNTRANSFER, 1); // post? if (is_array($d)) { if (!empty($d['post'])) { curl_setopt($curly[$id], CURLOPT_POST, 1); curl_setopt($curly[$id], CURLOPT_POSTFIELDS, $d['post']); } } // extra options? if (!empty($options)) { curl_setopt_array($curly[$id], $options); } curl_multi_add_handle($mh, $curly[$id]); } // execute the handles $running = null; do { curl_multi_exec($mh, $running); } while($running > 0); // get content and remove handles foreach($curly as $id => $c) { $result[$id] = curl_multi_getcontent($c); curl_multi_remove_handle($mh, $c); } // all done curl_multi_close($mh); return $result; } ?> <html> <head> <title>Fame Points -MO-</title> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.10/css/jquery.dataTables.min.css"> <script type="text/javascript" src="//code.jquery.com/jquery-1.11.3.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/s/dt/dt-1.10.10/datatables.min.css"/> <script type="text/javascript" src="https://cdn.datatables.net/s/dt/dt-1.10.10/datatables.min.js"></script> </head> <body> <table id="example" class="display" cellspacing="0"> <thead> <tr> <th>Player</th> <th>Battles</th> <th>Rank</th> <th>Fame Points</th> <th>Battles Needed</th> </tr> </thead> <tbody> <?php $data = run(); //print_r($data); foreach ($data as $value) { if($value[0]['battles']>0){ echo "<tr> <td>".$value[0]['account_name']."</td> <td>".$value[0]['battles']."</td> <td>".$value[0]['rank']."</td> <td>".$value[0]['fame_points']."</td> <td>".$value[0]['battles_to_award']."</td> </tr>"; } } ?> </tbody> </table> <script type="text/javascript"> $(document).ready(function() { $('#example').DataTable(); } ); </script> </body> </html>

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.0070.00716.88
8.3.50.0120.00316.25
8.3.40.0040.01418.74
8.3.30.0120.00318.80
8.3.20.0050.00220.34
8.3.10.0000.00821.73
8.3.00.0000.00821.78
8.2.180.0120.00318.60
8.2.170.0040.01122.96
8.2.160.0100.00319.38
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00020.76
8.2.110.0050.00519.27
8.2.100.0040.00817.72
8.2.90.0000.00817.84
8.2.80.0040.00418.34
8.2.70.0030.00717.50
8.2.60.0030.00617.50
8.2.50.0060.00317.62
8.2.40.0040.00417.62
8.2.30.0040.00419.57
8.2.20.0040.00417.68
8.2.10.0040.00418.09
8.2.00.0000.00818.27
8.1.280.0070.00725.92
8.1.270.0040.00422.18
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0070.00322.55
8.1.230.0100.00322.66
8.1.220.0030.00617.91
8.1.210.0060.00318.77
8.1.200.0030.00617.48
8.1.190.0060.00317.48
8.1.180.0030.00618.10
8.1.170.0050.00518.59
8.1.160.0000.00720.86
8.1.150.0040.00420.55
8.1.140.0050.00319.68
8.1.130.0000.00717.64
8.1.120.0040.00317.52
8.1.110.0040.00417.56
8.1.100.0040.00417.51
8.1.90.0070.00017.44
8.1.80.0000.00817.41
8.1.70.0030.00317.58
8.1.60.0040.00417.54
8.1.50.0040.00417.51
8.1.40.0060.00317.63
8.1.30.0000.00817.72
8.1.20.0060.00317.55
8.1.10.0050.00317.55
8.1.00.0040.00417.53
8.0.300.0000.00720.11
8.0.290.0080.00016.88
8.0.280.0000.00818.45
8.0.270.0000.00716.82
8.0.260.0060.00017.31
8.0.250.0030.00317.10
8.0.240.0000.00817.10
8.0.230.0030.00517.11
8.0.220.0040.00717.06
8.0.210.0050.00317.00
8.0.200.0030.00717.09
8.0.190.0030.00617.11
8.0.180.0040.00417.10
8.0.170.0000.00817.03
8.0.160.0070.00016.92
8.0.150.0030.00317.01
8.0.140.0000.00816.85
8.0.130.0060.00013.36
8.0.120.0080.00017.03
8.0.110.0040.00417.00
8.0.100.0040.00416.89
8.0.90.0000.00916.89
8.0.80.0150.00017.07
8.0.70.0040.00417.04
8.0.60.0060.00316.93
8.0.50.0040.00416.82
8.0.30.0080.00917.22
8.0.20.0070.01717.40
8.0.10.0030.00516.96
8.0.00.0100.01116.84
7.4.330.0000.00516.77
7.4.320.0030.00316.52
7.4.300.0030.00316.67
7.4.290.0070.00016.56
7.4.280.0040.00416.57
7.4.270.0000.00716.64
7.4.260.0000.00716.46
7.4.250.0040.00416.58
7.4.240.0030.00316.47
7.4.230.0040.00216.57
7.4.220.0140.01016.52
7.4.210.0110.00416.59
7.4.200.0050.00316.64
7.4.160.0060.00916.61
7.4.150.0110.00717.40
7.4.140.0090.00917.86
7.4.130.0080.00916.68
7.4.120.0120.00516.61
7.4.110.0040.01216.66
7.4.100.0220.01116.56
7.4.90.0130.00816.63
7.4.80.0120.00919.39
7.4.70.0100.00716.68
7.4.60.0100.01016.64
7.4.50.0080.00816.46
7.4.40.0180.00016.47
7.4.30.0120.00616.39
7.4.00.0070.01015.18
7.3.330.0000.00513.43
7.3.320.0000.00613.21
7.3.310.0040.00416.42
7.3.300.0030.00316.34
7.3.290.0080.00916.48
7.3.280.0080.01116.41
7.3.270.0120.01217.40
7.3.260.0100.00716.51
7.3.250.0070.01016.62
7.3.240.0080.00916.64
7.3.230.0160.00216.39
7.3.210.0050.01216.58
7.3.200.0090.00919.39
7.3.190.0060.00916.45
7.3.180.0060.01216.49
7.3.170.0000.01616.43
7.3.160.0100.01316.45
7.3.120.0040.01414.88
7.3.110.0140.00414.93
7.3.100.0100.01014.65
7.3.90.0090.00614.91
7.3.80.0070.00315.01
7.3.70.0040.00814.67
7.3.60.0040.01214.98
7.3.50.0030.01015.10
7.3.40.0030.00614.95
7.3.30.0030.00614.91
7.3.20.0000.01516.79
7.3.10.0040.00716.46
7.3.00.0040.01216.68
7.2.330.0100.00716.49
7.2.320.0030.02016.76
7.2.310.0100.01016.52
7.2.300.0110.00616.69
7.2.290.0110.00516.75
7.2.250.0060.01215.25
7.2.240.0060.01214.98
7.2.230.0040.01115.25
7.2.220.0100.00715.05
7.2.210.0090.00014.68
7.2.200.0090.00615.14
7.2.190.0090.00614.88
7.2.180.0050.00514.91
7.2.170.0000.01015.03
7.2.160.0040.01115.06
7.2.150.0030.01316.93
7.2.140.0030.00716.78
7.2.130.0030.01216.95
7.2.120.0040.01416.93
7.2.110.0060.01216.72
7.2.100.0110.00716.93
7.2.90.0070.01016.93
7.2.80.0080.00416.81
7.2.70.0030.01017.02
7.2.60.0090.00716.90
7.2.50.0150.00816.65
7.2.40.0070.01016.65
7.2.30.0060.00616.68
7.2.20.0060.00916.88
7.2.10.0000.01316.86
7.2.00.0100.00316.93
7.1.330.0030.01315.77
7.1.320.0100.00315.83
7.1.310.0070.00715.87
7.1.300.0070.00715.74
7.1.290.0000.01315.47
7.1.280.0100.00315.87
7.1.270.0070.00415.75
7.1.260.0040.01215.82
7.1.250.0040.00415.70
7.1.240.0070.00715.70
7.1.230.0040.00815.89
7.1.220.0070.01115.68
7.1.210.0070.01015.76
7.1.200.0080.00515.61
7.1.190.0060.00615.54
7.1.180.0100.00315.71
7.1.170.0060.00915.87
7.1.160.0000.01015.71
7.1.150.0070.00715.58
7.1.140.0070.00715.75
7.1.130.0060.00915.74
7.1.120.0040.00715.92
7.1.110.0030.00915.79
7.1.100.0030.00917.01
7.1.90.0030.00915.72
7.1.80.0070.00315.89
7.1.70.0040.00816.42
7.1.60.0100.00917.48
7.1.50.0110.00716.31
7.1.40.0070.00715.85
7.1.30.0000.01315.53
7.1.20.0040.00415.71
7.1.10.0030.01115.79
7.1.00.0060.04218.96
7.0.330.0060.00815.51
7.0.320.0060.00915.20
7.0.310.0000.01715.41
7.0.300.0040.01115.38
7.0.290.0040.00715.24
7.0.280.0050.00515.30
7.0.270.0040.01115.36
7.0.260.0120.00315.30
7.0.250.0080.00615.54
7.0.240.0110.00415.39
7.0.230.0050.00515.19
7.0.220.0090.00315.56
7.0.210.0000.01515.51
7.0.200.0260.01114.97
7.0.190.0110.00715.19
7.0.180.0100.00715.38
7.0.170.0060.00615.20
7.0.160.0000.01515.41
7.0.150.0060.00315.30
7.0.140.0090.00615.14
7.0.130.0090.00615.21
7.0.120.0090.00615.42
7.0.110.0040.01115.51
7.0.100.0040.01115.53
7.0.90.0070.01115.54
7.0.80.0110.00715.27
7.0.70.0030.01015.38
7.0.60.0120.04318.44
7.0.50.0050.03816.59
7.0.40.0050.02316.68
7.0.30.0130.02816.76
7.0.20.0120.03516.59
7.0.10.0100.03316.76
7.0.00.0070.04316.84
5.6.400.0090.00314.29
5.6.390.0110.00314.14
5.6.380.0090.00314.14
5.6.370.0000.01114.31
5.6.360.0070.00714.48
5.6.350.0060.00914.05
5.6.340.0030.00814.40
5.6.330.0000.01414.61
5.6.320.0040.00814.12
5.6.310.0140.00014.27
5.6.300.0000.01114.51
5.6.290.0030.01014.62
5.6.280.0040.03417.59
5.6.270.0000.01614.50
5.6.260.0040.00414.48
5.6.250.0070.00714.22
5.6.240.0050.00514.39
5.6.230.0080.01114.33
5.6.220.0060.00614.31
5.6.210.0070.04717.50
5.6.200.0100.01816.24
5.6.190.0050.04317.63
5.6.180.0250.04417.36
5.6.170.0180.03917.44
5.6.160.0070.04717.28
5.6.150.0070.02916.20
5.6.140.0030.02516.16
5.6.130.0030.03416.38
5.6.120.0080.02317.73
5.6.110.0020.05217.59
5.6.100.0070.02517.64
5.6.90.0030.04917.57
5.6.80.0050.04017.28
5.6.70.0160.00014.20
5.6.60.0040.01114.11
5.6.50.0040.01414.15
5.6.40.0060.00914.47
5.6.30.0040.01114.14
5.6.20.0120.00014.55
5.6.10.0030.01014.23
5.6.00.0030.01014.07
5.5.380.0000.01614.22
5.5.370.0000.01314.14
5.5.360.0070.00714.20
5.5.350.0190.03317.21
5.5.340.0070.04716.06
5.5.330.0100.04117.26
5.5.320.0120.04117.38
5.5.310.0200.03817.13
5.5.300.0090.04116.27
5.5.290.0060.02316.23
5.5.280.0030.04417.62
5.5.270.0050.04717.53
5.5.260.0050.03517.58
5.5.250.0050.03617.52
5.5.240.0170.03717.30
5.5.230.0030.01014.20
5.5.220.0030.01414.17
5.5.210.0100.00614.31
5.5.200.0100.00314.42
5.5.190.0100.00314.13
5.5.180.0000.01413.96
5.5.170.0060.00614.26
5.5.160.0000.01313.83
5.5.150.0060.00614.26
5.5.140.0100.00714.33
5.5.130.0040.01114.10
5.5.120.0030.01014.13
5.5.110.0070.01114.22
5.5.100.0100.00314.31
5.5.90.0100.00714.05
5.5.80.0080.00614.31
5.5.70.0100.00314.01
5.5.60.0060.00614.28
5.5.50.0030.01014.13
5.5.40.0070.00714.28
5.5.30.0090.00614.13
5.5.20.0030.01414.23
5.5.10.0030.01214.17
5.5.00.0030.00914.37

preferences:
69.03 ms | 400 KiB | 5 Q