3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_time_limit(28800); // PRZECZYTAJ, ZANIM ODPALISZ!!! // // Ten skrypt nie jest przystosowany do wyścigów! // Aby przyspieszyć głosowanie, można: // - odpalić więcej instancji skryptu // - zmienić czas pauzy przy funkcji usleep (całkowite usunięcie niezalecane) // - jeśli korzystasz z serwerów proxy, wprowadź adres ręcznie w polu $proxyServer // $lightcore = new Lightcore; $lightcore->setVoteUrl('http://swiecsie.wp.pl/wp_energa/add_vote.php'); $lightcore->setCityIds(213); $lightcore->setPhotoIds(327,326,325,324,323,322,321,320,255); $lightcore->setContestId(1); // UWAGA! Aby włączyć obsługę proxy, odkomentuj poniższą linijkę. // Domyślnie skrypt korzysta z zawodnej usługi GimmeProxy (chyba że zapłacimy) // Możesz też w polu $proxyServer wpisać własny serwer proxy, np. http://adres:port //$lightcore->enableProxy(); // Jeśli wszystko jest w porządku, zostaw linijkę zakomentowaną, aby nie śmiecić wyjścia. //$lightcore->enableDebugMode(); $lightcore->startBattle(); class Lightcore { private $voteUrl; private $contestId; private $cityIds; private $photoIds; private $useProxy; private $proxyServer = ''; private $debugMode; private $votesPerProxy = 5000; // po tym skrypt znów odwoła się do usługi GimmeProxy public function setCityIds($cityIds) { if (is_array($cityIds)) { $this->cityIds = $cityIds; } else { $this->cityIds = func_get_args(); } } public function setPhotoIds($photoIds) { if (is_array($photoIds)) { $this->photoIds = $photoIds; } else { $this->photoIds = func_get_args(); } } public function setContestId($contestId) { $this->contestId = $contestId; } public function setVoteUrl($voteUrl) { $this->voteUrl = $voteUrl; } public function setVotesPerProxy($number) { if (is_numeric($number) && $number > 0) { $this->votesPerProxy = $number; } } public function setInterval($seconds) { if (is_numeric($seconds) && $seconds >= 0) { $this->intervalBetweenVotes = $seconds; } } public function enableProxy() { $this->useProxy = true; } public function enableDebugMode() { $this->debugMode = true; } public function startBattle() { $enabled = true; $votesThisProxy = empty($this->proxyServer) ? 0 : PHP_INT_MAX; $this->debugMessage('URL: ' . $this->voteUrl); $this->debugMessage('Proxy: ' . ($this->useProxy ? 'YES' : 'NO')); $this->debugMessage('Votes per proxy: ' . $this->votesPerProxy); while ($enabled) { if ($this->useProxy && !$votesThisProxy) { $this->getRandomProxyServer(); $votesThisProxy = $this->votesPerProxy; } if ($this->useProxy) { $this->debugMessage('Preparing new request using proxy ' . $this->proxyServer); --$votesThisProxy; } else { $this->debugMessage('Preparing new request without proxy'); } $this->sendVoteToServer(); usleep(mt_rand(20000,50000)); } } private function sendVoteToServer() { $gid = $this->getRandomCityId(); $photoId = $this->getRandomPhotoId(); $body = http_build_Something is wrong(array( 'contest_id' => $this->contestId, 'fb_id' => $this->getRandomFacebookUserId(), 'gid' => $gid )); $this->debugMessage($body); $extraHeaders = array( "X-Requested-With: XMLHttpRequest", "Referer: http://swiecsie.wp.pl/swietlna-stolica-polski/final/one,1,{$gid},{$photoId},swiateczna-stalowa-wola.html", "User-Agent: " . $this->getRandomUserAgent() ); $answer = $this->sendRequestToServerAndGetResponse($body, $extraHeaders); if (isset($answer->success)) { $this->outputMessage($answer->success); } else { $this->outputMessage('Unexpected response from server'); print_r($answer); } } private function sendRequestToServerAndGetResponse($body, $headers) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->voteUrl); if ($this->useProxy) { curl_setopt($ch, CURLOPT_PROXY, $this->proxyServer); } curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $body); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $ans = curl_exec($ch); curl_close($ch); $pos1 = strpos($ans, '{'); $pos2 = strrpos($ans, '}'); $this->debugMessage($ans); return json_decode(substr($ans, $pos1, $pos2 - $pos1 + 1)); } private function getRandomProxyServer() { $trials = 10; while ($trials) { $this->debugMessage('Getting proxy server...'); $answer = json_decode(file_get_contents('http://gimmeproxy.com/api/getProxy?post=true&get=true')); if (is_object($answer) && isset($answer->curl)) { $this->outputMessage('Changed proxy server to ' . $answer->curl); $this->proxyServer = $answer->curl; return true; } --$trials; sleep(10); // jak nie zapłacisz, to i tak nic to nie da } } private function outputMessage($message) { echo '[' . date('H:i:s') . '] ' . $message . PHP_EOL; } private function getRandomFacebookUserId() { return '100003' . mt_rand(100000000, 999999999); } private function getRandomCityId() { return $this->cityIds[array_rand($this->cityIds)]; } private function getRandomPhotoId() { return $this->photoIds[array_rand($this->photoIds)]; } private function debugMessage($message) { if ($this->debugMode) { $this->outputMessage($message); } } private function getRandomUserAgent() { $all = array( 'Opera/9.80 (Windows NT 5.1) Presto/2.12.388 Version/12.18', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.85 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0', 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.1 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2226.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.4; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2225.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2225.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2224.3 Safari/537.36', 'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.93 Safari/537.36', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 4.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.67 Safari/537.36', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.67 Safari/537.36', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1944.0 Safari/537.36', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.3319.102 Safari/537.36', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.2309.372 Safari/537.36', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.2117.157 Safari/537.36', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36', 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1866.237 Safari/537.36', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1664.3 Safari/537.36', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1664.3 Safari/537.36', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1', 'Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10; rv:33.0) Gecko/20100101 Firefox/33.0', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20130401 Firefox/31.0', 'Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20120101 Firefox/29.0', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/29.0', 'Mozilla/5.0 (Windows NT 6.1; rv:27.3) Gecko/20130101 Firefox/27.3', 'Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:27.0) Gecko/20121011 Firefox/27.0', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:25.0) Gecko/20100101 Firefox/25.0', 'Mozilla/5.0 (Windows NT 6.0; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Firefox/24.0', 'Mozilla/5.0 (Windows NT 6.2; rv:22.0) Gecko/20130405 Firefox/23.0', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20130406 Firefox/23.0', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:23.0) Gecko/20131011 Firefox/23.0', 'Mozilla/5.0 (Windows NT 6.2; rv:22.0) Gecko/20130405 Firefox/22.0', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:22.0) Gecko/20130328 Firefox/22.0', 'Mozilla/5.0 (Windows NT 6.1; rv:22.0) Gecko/20130405 Firefox/22.0', 'Mozilla/5.0 (Microsoft Windows NT 6.2.9200.0); rv:22.0) Gecko/20130405 Firefox/22.0', 'Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:16.0.1) Gecko/20121011 Firefox/21.0.1', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:16.0.1) Gecko/20121011 Firefox/21.0.1', 'Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:21.0.0) Gecko/20121011 Firefox/21.0.0', 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:21.0) Gecko/20130514 Firefox/21.0', 'Mozilla/5.0 (Windows NT 6.2; rv:21.0) Gecko/20130326 Firefox/21.0', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20130401 Firefox/21.0', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20130331 Firefox/21.0', 'Mozilla/5.0 (Windows NT 6.1; rv:21.0) Gecko/20130401 Firefox/21.0', 'Mozilla/5.0 (Windows NT 5.1; rv:21.0) Gecko/20130401 Firefox/21.0', 'Mozilla/5.0 (Windows NT 5.0; rv:21.0) Gecko/20100101 Firefox/21.0', ); return $all[array_rand($all)]; } }

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.50.0160.00017.82
8.3.40.0180.01417.21
8.3.30.0190.01020.17
8.3.20.0150.01320.46
8.3.10.0170.00920.46
8.3.00.0190.00820.11
8.2.180.0290.00518.05
8.2.170.0260.00917.50
8.2.160.0220.00620.23
8.2.150.0200.00820.04
8.2.140.0230.00420.04
8.2.130.0150.00919.74
8.2.120.0150.00820.32
8.2.110.0160.01019.72
8.2.100.0190.00719.47
8.2.90.0250.00418.78
8.2.80.0200.00718.55
8.2.70.0200.00618.40
8.2.60.0170.00718.08
8.2.50.0140.00818.20
8.2.40.0160.00518.00
8.2.30.0160.00418.03
8.2.20.0120.00718.03
8.2.10.0130.00517.89
8.2.00.0140.00617.89
8.1.280.0250.01515.75
8.1.270.0110.00721.38
8.1.260.0210.00619.32
8.1.250.0160.01219.32
8.1.240.0190.00919.02
8.1.230.0160.01118.81
8.1.220.0170.00818.55
8.1.210.0180.00618.50
8.1.200.0190.00518.21
8.1.190.0130.00717.79
8.1.180.0140.00817.83
8.1.170.0150.00617.90
8.1.160.0140.00617.90
8.1.150.0150.00517.90
8.1.140.0130.00617.71
8.1.130.0130.00617.71
8.1.120.0140.00617.79
8.1.110.0150.00417.75
8.1.100.0130.00617.78
8.1.90.0130.00717.78
8.1.80.0140.00517.76
8.1.70.0140.00517.76
8.1.60.0160.00517.82
8.1.50.0150.00717.82
8.1.40.0150.00617.86
8.1.30.0150.00517.77
8.1.20.0150.00517.74
8.1.10.0130.00617.65
8.1.00.0140.00617.63
8.0.300.0190.00518.17
8.0.290.0180.00517.93
8.0.280.0140.00517.69
8.0.270.0120.00617.44
8.0.260.0130.00517.44
8.0.250.0130.00517.47
8.0.240.0110.00717.55
8.0.230.0130.00517.57
8.0.220.0120.00517.50
8.0.210.0130.00517.55
8.0.200.0130.00517.66
8.0.190.0130.00517.57
8.0.180.0110.00617.53
8.0.170.0100.00717.56
8.0.160.0110.00617.46
8.0.150.0110.00517.36
8.0.140.0120.00517.34
8.0.130.0110.00517.29
8.0.120.0110.00517.29
8.0.110.0120.00417.34
8.0.100.0100.00517.20
8.0.90.0100.00517.16
8.0.80.0120.00517.09
8.0.70.0110.00617.07
8.0.60.0110.00517.09
8.0.50.0100.00617.08
8.0.30.0110.00617.09
8.0.20.0110.00617.13
8.0.10.0110.00717.14
8.0.00.0100.00717.13
7.4.330.0110.00417.01
7.4.320.0140.00617.24
7.4.300.0150.00517.25
7.4.290.0160.00417.27
7.4.280.0140.00517.07
7.4.270.0130.00517.03
7.4.260.0160.00416.95
7.4.250.0150.00516.96
7.4.240.0140.00516.91
7.4.230.0110.00616.81
7.4.220.0100.00416.80
7.4.210.0110.00516.76
7.4.200.0120.00516.75
7.4.190.0110.00516.83
7.4.180.0110.00516.81
7.4.160.0120.00516.75
7.4.150.0120.00616.71
7.4.140.0120.00616.63
7.4.130.0120.00516.62
7.4.120.0120.00616.58
7.4.110.0120.00616.58
7.4.100.0110.00616.65
7.4.90.0110.00716.56
7.4.80.0110.00716.56
7.4.70.0110.00716.56
7.4.60.0120.00616.58
7.4.50.0110.00716.52
7.4.40.0110.00716.50
7.4.30.0110.00716.57
7.4.20.0110.00716.48
7.4.10.0100.00716.51
7.4.00.0110.00616.49
7.3.330.0150.00416.91
7.3.320.0140.00416.86
7.3.310.0140.00416.80
7.3.300.0120.00316.68
7.3.290.0110.00516.61
7.3.280.0120.00516.61
7.3.270.0120.00616.58
7.3.260.0120.00716.55
7.3.250.0130.00516.52
7.3.240.0130.00616.53
7.3.230.0120.00616.55
7.3.220.0130.00616.47
7.3.210.0130.00616.48
7.3.200.0120.00616.46
7.3.190.0130.00616.45
7.3.180.0120.00616.50
7.3.170.0120.00616.44
7.3.160.0120.00716.44
7.3.150.0110.00716.44
7.3.140.0120.00716.46
7.3.130.0120.00716.41
7.3.120.0120.00716.35
7.3.110.0110.00716.21
7.3.100.0110.00716.18
7.3.90.0110.00716.20
7.3.80.0110.00716.13
7.3.70.0110.00616.11
7.3.60.0100.00716.14
7.3.50.0100.00716.07
7.3.40.0110.00716.08
7.3.30.0100.00716.07
7.3.20.0140.00716.45
7.3.10.0130.00716.42
7.3.00.0130.00716.42
7.2.340.0160.00516.53
7.2.330.0140.00716.53
7.2.320.0140.00716.51
7.2.310.0140.00616.50
7.2.300.0150.00616.49
7.2.290.0130.00716.48
7.2.280.0140.00716.51
7.2.270.0130.00816.45
7.2.260.0130.00716.43
7.2.250.0130.00716.40
7.2.240.0120.00816.28
7.2.230.0130.00716.22
7.2.220.0120.00716.21
7.2.210.0120.00816.16
7.2.200.0130.00716.20
7.2.190.0110.00816.21
7.2.180.0120.00816.15
7.2.170.0110.00816.16
7.2.160.0120.00816.14
7.2.150.0150.00816.55
7.2.140.0150.00816.57
7.2.130.0140.00816.62
7.2.120.0160.00716.58
7.2.110.0150.00716.58
7.2.100.0150.00816.59
7.2.90.0170.00716.55
7.2.80.0180.00716.54
7.2.70.0150.00816.58
7.2.60.0160.00816.52
7.2.50.0170.00716.53
7.2.40.0180.00716.56
7.2.30.0180.00716.58
7.2.20.0180.00716.60
7.2.10.0150.00816.58
7.2.00.0160.00816.60
7.1.330.0160.00715.88
7.1.320.0150.00715.75
7.1.310.0130.00715.76
7.1.300.0130.00715.75
7.1.290.0140.00615.75
7.1.280.0150.00715.72
7.1.270.0150.00715.65
7.1.260.0150.00715.63
7.1.250.0150.00715.61
7.1.240.0170.00715.61
7.1.230.0150.00715.62
7.1.220.0160.00715.62
7.1.210.0170.00715.59
7.1.200.0150.00715.61
7.1.190.0160.00615.62
7.1.180.0180.00715.56
7.1.170.0160.00715.56
7.1.160.0160.00615.54
7.1.150.0160.00815.57
7.1.140.0160.00715.59
7.1.130.0170.00715.60
7.1.120.0170.00715.61
7.1.110.0170.00715.57
7.1.100.0180.00715.61
7.1.90.0170.00715.60
7.1.80.0170.00715.63
7.1.70.0170.00715.57
7.1.60.0180.00716.19
7.1.50.0190.00716.17
7.1.40.0200.00716.15
7.1.30.0170.00716.16
7.1.20.0190.00716.17
7.1.10.0170.00715.58
7.1.00.0170.00715.54
7.0.330.0150.00715.42
7.0.320.0170.00715.40
7.0.310.0150.00715.40
7.0.300.0160.00715.37
7.0.290.0160.00715.36
7.0.280.0160.00715.38
7.0.270.0160.00715.40
7.0.260.0160.00715.40
7.0.250.0160.00715.46
7.0.240.0170.00715.46
7.0.230.0180.00815.49
7.0.220.0170.00715.44
7.0.210.0170.00715.38
7.0.200.0160.00715.37
7.0.190.0160.00715.42
7.0.180.0170.00715.40
7.0.170.0180.00715.41
7.0.160.0160.00815.37
7.0.150.0160.00715.38
7.0.140.0160.00715.36
7.0.130.0150.00715.40
7.0.120.0160.00715.40
7.0.110.0150.00715.37
7.0.100.0160.00715.36
7.0.90.0170.00715.36
7.0.80.0140.00815.33
7.0.70.0150.00715.36
7.0.60.0180.00715.35
7.0.50.0170.00615.35
7.0.40.0160.00715.36
7.0.30.0160.00715.37
7.0.20.0150.00715.34
7.0.10.0180.00715.38
7.0.00.0160.00615.35
5.6.400.0130.00815.62
5.6.390.0120.00815.62
5.6.380.0130.00815.63
5.6.370.0130.00815.88
5.6.360.0130.00815.88
5.6.350.0130.00715.88
5.6.340.0120.00815.89
5.6.330.0130.00715.88
5.6.320.0130.00715.90
5.6.310.0140.00715.87
5.6.300.0140.00815.96
5.6.290.0130.01015.95
5.6.280.0120.00915.96
5.6.270.0130.00915.97
5.6.260.0130.00915.97
5.6.250.0120.01015.96
5.6.240.0120.01015.96
5.6.230.0130.00915.97
5.6.220.0130.01015.97
5.6.210.0140.00915.93
5.6.200.0130.01016.02
5.6.190.0140.00915.99
5.6.180.0140.01016.00
5.6.170.0140.00915.98
5.6.160.0130.00915.98
5.6.150.0130.01016.00
5.6.140.0140.00816.00
5.6.130.0130.00915.99
5.6.120.0130.00915.97
5.6.110.0130.01015.93
5.6.100.0130.01015.96
5.6.90.0130.00915.95
5.6.80.0130.00915.90
5.6.70.0120.00915.94
5.6.60.0120.01015.94
5.6.50.0120.00915.90
5.6.40.0120.01015.91
5.6.30.0130.00915.91
5.6.20.0120.00915.89
5.6.10.0120.01015.91
5.6.00.0120.01015.93

preferences:
132.02 ms | 1394 KiB | 7 Q