3v4l.org

run code in 300+ PHP versions simultaneously
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <?php $url = "http://apt.saurik.com/debs/"; $opt = array("http" => array('ignore_errors' => true)); $options = array( 'http' => array( 'method' => 'GET', 'header' => 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25', ), ); $context = stream_context_create($options); //ファイル取得 $file = file_get_contents($url, false, $context); $namepat = '/<a.*?<\/a>".*?"/'; preg_match_all($namepat, $file, $data, PREG_SET_ORDER); //日付を先に取得 $date = time(); $dates = date("Y/m/d H:i:s",$date); //echo date("Y/m/d H:i:s",$date); foreach ($data as $name) { echo $name[0]."<br />"; }
Output for 7.0.20, 7.1.5 - 7.1.33, 7.2.0 - 7.2.25, 7.3.0 - 7.3.12, 7.4.0
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/cjPlY on line 15 Warning: file_get_contents(http://apt.saurik.com/debs/): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/cjPlY on line 15
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.10, 7.1.0
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/cjPlY on line 15 Warning: file_get_contents(http://apt.saurik.com/debs/): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/cjPlY on line 15

preferences:
142.88 ms | 403 KiB | 179 Q