PHP  
 PHP_7_1
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/curl/tests/curl_basic_020.phpt ('Test curl_getinfo() function with CURLINFO_HTTP_CODE parameter')

Script

1: <?php
2:   
include 'server.inc';
3:   
$host curl_cli_server_start();
4:
5:   
$url "{$host}/get.php?test=";
6:   
$ch  curl_init();
7:   
curl_setopt($chCURLOPT_URL$url);
8:   
curl_exec($ch);
9:   
var_dump(curl_getinfo($chCURLINFO_HTTP_CODE));
10:   
curl_close($ch);
11:
?>
12:
===DONE===
13:

Expected

Hello World!
Hello World!int(200)
===DONE===

Output

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /responder/get.php was not found on this server.</p>
</body></html>
int(404)
===DONE===

Diff

001+ <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
002+ <html><head>
003+ <title>404 Not Found</title>
004+ </head><body>
005+ <h1>Not Found</h1>
006+ <p>The requested URL /responder/get.php was not found on this server.</p>
007+ </body></html>
008+ int(404)
001- Hello World!
002- Hello World!int(200)

 

Generated at Fri, 15 Mar 2019 21:51:14 +0000 (7 days ago)

Copyright © 2005-2019 The PHP Group
All rights reserved.