From: Johannes Schlüter Date: Sat, 3 Mar 2007 10:27:04 +0000 (+0000) Subject: - Fix old behaviour, ob_list_handlers() should always return an array X-Git-Tag: RELEASE_1_0_1~126 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=65aca2f200f63df70435990243ad5eb70eb75fed;p=php - Fix old behaviour, ob_list_handlers() should always return an array --- diff --git a/main/output.c b/main/output.c index 538e879961..f3aac67ca6 100644 --- a/main/output.c +++ b/main/output.c @@ -1504,11 +1504,13 @@ PHP_FUNCTION(ob_list_handlers) if (ZEND_NUM_ARGS()) { ZEND_WRONG_PARAM_COUNT(); } + + array_init(return_value); + if (!OG(active)) { - RETURN_FALSE; + return; } - array_init(return_value); zend_stack_apply_with_argument(OG(handlers), ZEND_STACK_APPLY_BOTTOMUP, php_output_stack_apply_list, return_value); } /* }}} */ diff --git a/tests/output/ob_020.phpt b/tests/output/ob_020.phpt new file mode 100644 index 0000000000..05f66cc584 --- /dev/null +++ b/tests/output/ob_020.phpt @@ -0,0 +1,38 @@ +--TEST-- +output buffering - ob_list_handlers +--FILE-- + +--EXPECT-- +Array +( +) +Array +( + [0] => default output handler +) +Array +( + [0] => default output handler + [1] => default output handler +) +Array +( + [0] => default output handler +) +Array +( +)