#40104 [Opn->Bgs]: Workflow Issue: Object destruction vs Output buffer

From: Date: Fri, 12 Jan 2007 08:29:14 +0000
Subject: #40104 [Opn->Bgs]: Workflow Issue: Object destruction vs Output buffer
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-107523@lists.php.net to get a copy of this message
ID: 40104 Updated by: tony2001@php.net Reported By: denis at mesoconcepts dot com -Status: Open +Status: Bogus Bug Type: Output Control Operating System: all (php related) PHP Version: 5.2.0 New Comment: This is the way it works since 5.1.x and we're not going to change it again. Previous Comments: ------------------------------------------------------------------------ [2007-01-11 22:42:03] denis at mesoconcepts dot com Description: ------------ Starting with php 5.2, objects are destroyed before output buffer handlers are called. Reproduce code: --------------- class foo { function bar() { } } $GLOBALS['fb'] =& new foo; function foo_bar($buffer) { $GLOBALS['fb']->bar(); return $buffer; } ob_start('foo_bar'); Expected result: ---------------- The code should not spit an error due to the $fb object not being initialized, as was the case prior to php 5.2. Actual result: -------------- PHP Fatal error: Call to a member function bar() on a non-object ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40104&edit=1

« previous php.bugs (#107523) next »