Edit report at https://bugs.php.net/bug.php?id=64152&edit=1

 ID:                 64152
 Updated by:         m...@php.net
 Reported by:        mmicael at gmail dot com
 Summary:            php return wrong string with HEAD Request Method
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            Output Control
 Operating System:   linux
 PHP Version:        5.4.11
 Block user comment: N
 Private report:     N

 New Comment:

I cannot see a bug here, sure execution of the script continues...


Previous Comments:
------------------------------------------------------------------------
[2013-02-05 13:26:05] mmicael at gmail dot com

It's not the same bug

the other bug have already been integrated in php 5.4.11

my bug only appears with HEAD request_method

------------------------------------------------------------------------
[2013-02-05 13:16:56] yvan at dugwood dot com

Seems to be a duplicate of https://bugs.php.net/bug.php?id=61272

------------------------------------------------------------------------
[2013-02-05 11:54:55] mmicael at gmail dot com

It seems that the behaviour have change with this commit 

https://github.com/php/php-src/commit/11d24c1593d6617f73d3f290617bd8994182f4dc#

the ouput.c don't care anymore about headers_only

------------------------------------------------------------------------
[2013-02-05 11:00:42] mmicael at gmail dot com

Modifiying OS

------------------------------------------------------------------------
[2013-02-05 10:51:49] mmicael at gmail dot com

Description:
------------
When we do a HEAD Request Method in php 5.4, php continue executing script even 
if the output buffer exceed the max output_buffering.

the next ob_start, ob_get_contents always return empty string

In php 5.2 and 5.3, the script die after sending the first output buffer that 
reach  the max output_buffering.

Test script:
---------------
$string = '';
for($i=0;$i<5000;$i++) $string .= '0';

ob_start();
echo "test1";
$content = ob_get_contents();
ob_end_clean();

error_log("1-$content");
echo $string;

ob_start();
echo "test2";
$content .= ob_get_contents();
ob_end_clean();

echo $string;

error_log("2-$content");

Expected result:
----------------
In php 5.2 and 5.3

1-test1

Actual result:
--------------
In php 5.4

1-test1
2-test1


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64152&edit=1

Reply via email to