Doc #62019 [Com]: ob_get_status returns 'flags' bitmask instead of 'status' array key
Edit report at https://bugs.php.net/bug.php?id=62019&edit=1
ID: 62019
Comment by: mikemill at gmail dot com
Reported by: zegenie at gmail dot com
Summary: ob_get_status returns 'flags' bitmask instead of
'status' array key
Status: Open
Type: Documentation Problem
Package: Documentation problem
Operating System: Any
PHP Version: 5.4.3
Block user comment: N
Private report: N
New Comment:
Additionally, the values of the constants seems to be incorrect.
The test of
<?php
ob_start();
print_r(ob_get_status());
echo "PHP_OUTPUT_HANDLER_END:";
var_dump(PHP_OUTPUT_HANDLER_END);
produces
Array
(
[level] => 1
[type] => 1
[status] => 0
[name] => default output handler
[del] => 1
)
PHP_OUTPUT_HANDLER_END:int(4)
on PHP 5.3.6
and
Array
(
[name] => default output handler
[type] => 0
[flags] => 112
[level] => 0
[chunk_size] => 0
[buffer_size] => 16384
[buffer_used] => 0
)
PHP_OUTPUT_HANDLER_END:int(8)
on PHP 5.4.4
Previous Comments:
------------------------------------------------------------------------
[2012-05-14 09:01:54] zegenie at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.ob-get-status#refsect1-function.ob-get-status-returnvalues
---
In php 5.4.x, the return value from ob_get_status() no longer contains the 'status' array
key. This seems to have been replaced with a 'flags' array key, breaking BC.
Test script:
---------------
<?php
ob_start();
$ob_status = ob_get_status();
echo (array_key_exists('status', $ob_status)) ? "'status' key exists"
: "'status' key does not exist\n"
echo (array_key_exists('flags', $ob_status)) ? "'flags' key exists" :
"'flags' key does not exist\n"
Expected result:
----------------
'status' key exists
'flags' key does not exist
Actual result:
--------------
'status' key does not exist
'flags' key exists
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62019&edit=1
Thread (10 messages)