3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $adep = $_GET['adep']; $ades = $_GET['ades']; $postdata = http_build_query( array( 'adep' => $adep, 'ades' => $ades ) ); $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata ) ); $context = stream_context_create($opts); $result = file_get_contents('http://www.cgna.gov.br/sistemas/harpia/rotas.php', false, $context); preg_match_all("'<tr><td>".$adep." </td><td>".$ades." </td>(.*?)<\/tr>'si", $result, $match1); preg_match_all("'<tr><td class=\'alt\'>".$adep." </td><td class=\'alt\'>".$ades." </td>(.*?)<\/tr>'si", $result, $match2); foreach($match1[1] as $rota) { preg_match("'<td>(.*?)<\/td>'si", $rota, $match_rota1); echo $match_rota1[1]; } foreach($match2[1] as $rota) { preg_match("'<td class=\'alt\'>(.*?)<\/td>'si", $rota, $match_rota2); echo $match_rota2[1]; }
Output for 5.5.24 - 5.5.31, 5.5.34 - 5.6.17, 5.6.20 - 7.0.3, 7.0.5 - 7.1.0
Notice: Undefined index: adep in /in/6BFBG on line 2 Notice: Undefined index: ades in /in/6BFBG on line 3 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/6BFBG on line 23 Warning: file_get_contents(http://www.cgna.gov.br/sistemas/harpia/rotas.php): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/6BFBG on line 23
Output for 5.3.0 - 5.4.45, 5.5.32 - 5.5.33, 5.6.18 - 5.6.19, 7.0.4
Notice: Undefined index: adep in /in/6BFBG on line 2 Notice: Undefined index: ades in /in/6BFBG on line 3 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/6BFBG on line 23 Warning: file_get_contents(http://www.cgna.gov.br/sistemas/harpia/rotas.php): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/6BFBG on line 23
Output for 5.2.6 - 5.2.17
Notice: Undefined index: adep in /in/6BFBG on line 2 Notice: Undefined index: ades in /in/6BFBG on line 3 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/6BFBG on line 23 Warning: file_get_contents(http://www.cgna.gov.br/sistemas/harpia/rotas.php): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/6BFBG on line 23
Output for 5.0.3 - 5.2.5
Notice: Undefined index: adep in /in/6BFBG on line 2 Notice: Undefined index: ades in /in/6BFBG on line 3 Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/6BFBG on line 23 Warning: file_get_contents(http://www.cgna.gov.br/sistemas/harpia/rotas.php): failed to open stream: Connection refused in /in/6BFBG on line 23
Output for 5.0.1 - 5.0.2
Notice: Undefined index: adep in /in/6BFBG on line 2 Notice: Undefined index: ades in /in/6BFBG on line 3 Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/6BFBG on line 23 Warning: file_get_contents(http://www.cgna.gov.br/sistemas/harpia/rotas.php): failed to open stream: Resource temporarily unavailable in /in/6BFBG on line 23
Output for 5.0.0
Notice: Undefined index: adep in /in/6BFBG on line 2 Notice: Undefined index: ades in /in/6BFBG on line 3 Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed in /in/6BFBG on line 23 Warning: file_get_contents(http://www.cgna.gov.br/sistemas/harpia/rotas.php): failed to open stream: Bad file descriptor in /in/6BFBG on line 23
Output for 4.4.5 - 4.4.9
Notice: Undefined index: adep in /in/6BFBG on line 2 Notice: Undefined index: ades in /in/6BFBG on line 3 Fatal error: Call to undefined function: http_build_query() in /in/6BFBG on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Notice: Undefined index: adep in /in/6BFBG on line 2 Notice: Undefined index: ades in /in/6BFBG on line 3 Fatal error: Call to undefined function: http_build_query() in /in/6BFBG on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Undefined index: adep in /in/6BFBG on line 2 Notice: Undefined index: ades in /in/6BFBG on line 3 Fatal error: Call to undefined function: http_build_query() in /in/6BFBG on line 6