3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $pages = array( 'http://www.talaka.by/projects/page/1?status=&category=&promo=razam_minsk', 'http://www.talaka.by/projects/page/2?status=&category=&promo=razam_minsk', 'http://www.talaka.by/projects/page/3?status=&category=&promo=razam_minsk', ); $projects = array(); foreach($pages as $page) { $raw_data = file_get_contents("$page"); $m = array(); preg_match_all("/\/projects\/([\d]+)/i", $raw_data, $m); $projects = array_merge($projects, $m[1]); } $projects = array_unique($projects); //echo '<pre>'.print_r($projects,1); // die(); $result = array(); foreach($projects as $project) { $url = "http://www.talaka.by/projects/$project"; $raw_data = file_get_contents("$url"); /*$ch = curl_init("$url"); $result[$project] = array(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_VERBOSE, 2); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0"); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Expect:")); curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); $t = microtime(1); $raw_data = curl_exec($ch);*/ //echo '<pre>'.print_r($raw_data); $m = array(); preg_match_all('/\<title\>(.*)\<\/title\>/i', $raw_data, $m); //echo '<pre>'.print_r($m,1); $result[$project]['title'] = $m[1][0]; $result[$project]['title'] = str_replace(' | Talaka.by','',$result[$project]['title']); $m = array(); preg_match_all('/Config\.followers\=\[([^\[\]]+)\]/i', $raw_data, $m); //echo '<pre>'.print_r($m,1); $json = "[".$m[1][0]."]"; $arr = json_decode($json); //echo '<pre>'.print_r($arr,1); $result[$project]['count'] = count($arr); $m = array(); preg_match_all('/\<span class\=\"percents\"\>\<span\>([\d]+)\<\/span\>%\<\/span\>/i', $raw_data, $m); //echo '<pre>'.print_r($m,1); die(); $result[$project]['percent'] = $m[1][0]; } function comparef($a, $b) { return $a['count'] < $b['count'] ? 1 : -1; } uasort($result, 'comparef'); //echo '<pre>'.print_r($result,1); die(); foreach($result as $project => $val) { echo $val['count']."\t".$val['percent']."%\t".$val['title']." http://www.talaka.by/projects/$project <br>"; }
Output for 5.2.6 - 5.4.45, 5.5.33, 5.6.18 - 5.6.19, 7.0.4, 7.0.20, 7.1.5 - 7.2.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/1?status=&category=&promo=razam_minsk): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/vVnNe on line 13 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/2?status=&category=&promo=razam_minsk): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/vVnNe on line 13 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/3?status=&category=&promo=razam_minsk): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/vVnNe on line 13
Output for 5.5.24 - 5.5.32, 5.5.34 - 5.6.17, 5.6.20 - 7.0.3, 7.0.5 - 7.0.6, 7.1.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/1?status=&category=&promo=razam_minsk): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/vVnNe on line 13 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/2?status=&category=&promo=razam_minsk): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/vVnNe on line 13 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/3?status=&category=&promo=razam_minsk): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/vVnNe on line 13
Output for 4.3.3 - 4.3.4, 4.3.10 - 4.4.9, 5.0.3 - 5.2.5
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/1?status=&category=&promo=razam_minsk): failed to open stream: Connection refused in /in/vVnNe on line 13 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/2?status=&category=&promo=razam_minsk): failed to open stream: Connection refused in /in/vVnNe on line 13 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/3?status=&category=&promo=razam_minsk): failed to open stream: Connection refused in /in/vVnNe on line 13
Output for 4.3.5 - 4.3.9, 5.0.1 - 5.0.2
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/1?status=&category=&promo=razam_minsk): failed to open stream: Resource temporarily unavailable in /in/vVnNe on line 13 Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/2?status=&category=&promo=razam_minsk): failed to open stream: Resource temporarily unavailable in /in/vVnNe on line 13 Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/3?status=&category=&promo=razam_minsk): failed to open stream: Resource temporarily unavailable in /in/vVnNe on line 13
Output for 5.0.0
Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/1?status=&category=&promo=razam_minsk): failed to open stream: Bad file descriptor in /in/vVnNe on line 13 Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/2?status=&category=&promo=razam_minsk): failed to open stream: Bad file descriptor in /in/vVnNe on line 13 Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/3?status=&category=&promo=razam_minsk): failed to open stream: Bad file descriptor in /in/vVnNe on line 13
Output for 4.3.2
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/1?status=&category=&promo=razam_minsk): failed to open stream: Connection refused in /in/vVnNe on line 13 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/2?status=&category=&promo=razam_minsk): failed to open stream: Connection refused in /in/vVnNe on line 13 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error (is your IPV6 configuration correct? If this error happens all the time, try reconfiguring PHP using --disable-ipv6 option to configure) in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/3?status=&category=&promo=razam_minsk): failed to open stream: Connection refused in /in/vVnNe on line 13
Output for 4.3.0 - 4.3.1
Warning: file_get_contents() [http://www.php.net/function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: System error in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/1?status=&category=&promo=razam_minsk) [http://www.php.net/function.file-get-contents]: failed to create stream: Connection refused in /in/vVnNe on line 13 Warning: file_get_contents() [http://www.php.net/function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: System error in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/2?status=&category=&promo=razam_minsk) [http://www.php.net/function.file-get-contents]: failed to create stream: Connection refused in /in/vVnNe on line 13 Warning: file_get_contents() [http://www.php.net/function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: System error in /in/vVnNe on line 13 Warning: file_get_contents(http://www.talaka.by/projects/page/3?status=&category=&promo=razam_minsk) [http://www.php.net/function.file-get-contents]: failed to create stream: Connection refused in /in/vVnNe on line 13