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

Test Failure Report for tests/basic/bug67198.phpt ('php://input is empty when enable_post_data_reading=Off')

Script

1: <?php
2:
require __DIR__."/../../sapi/cli/tests/php_cli_server.inc";
3:
4:
$code =
5: <<<'FL'
6:
 if(!ini_get('enable_post_data_reading')){
7:   if($_SERVER['REQUEST_METHOD']=='POST'){
8:    exit(file_get_contents('php://input'));
9:   }
10:  }else{
11:   exit('Please SET php.ini: enable_post_data_reading = Off');
12:  }
13:
FL;
14:
15:
$postdata "PASS";
16:
17:
$opts = array('http' =>
18:     array(
19:         
'method'  => 'POST',
20:         
'header'  => 'Content-type: application/x-www-form-urlencoded',
21:         
'content' => $postdata
22:     
)
23: );
24:
25:
$context  stream_context_create($opts);
26:
27:
php_cli_server_start("exit(file_get_contents('php://input'));"false"-d enable_post_data_reading=Off");
28:
29:
var_dump(file_get_contents("http://" PHP_CLI_SERVER_ADDRESSfalse$context));
30:
var_dump(file_get_contents("http://" PHP_CLI_SERVER_ADDRESSfalse$context));
31:

Expected

string(4) "PASS"
string(4) "PASS"

Output

Warning: file_get_contents(http://localhost:8964): failed to open stream: Connection refused in /var/php_gcov/PHP_5_6/tests/basic/bug67198.php on line 29
bool(false)

Warning: file_get_contents(http://localhost:8964): failed to open stream: Connection refused in /var/php_gcov/PHP_5_6/tests/basic/bug67198.php on line 30
bool(false)

Diff

001+ Warning: file_get_contents(http://localhost:8964): failed to open stream: Connection refused in /var/php_gcov/PHP_5_6/tests/basic/bug67198.php on line 29
002+ bool(false)
001- string(4) "PASS"
002- string(4) "PASS"
003+ 
004+ Warning: file_get_contents(http://localhost:8964): failed to open stream: Connection refused in /var/php_gcov/PHP_5_6/tests/basic/bug67198.php on line 30
005+ bool(false)

 

Generated at Wed, 10 Dec 2014 19:30:08 +0000 (10 days ago)

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