php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40104 Workflow Issue: Object destruction vs Output buffer
Submitted: 2007-01-11 22:42 UTC Modified: 2007-01-12 08:29 UTC
From: denis at mesoconcepts dot com Assigned:
Status: Not a bug Package: Output Control
PHP Version: 5.2.0 OS: all (php related)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: denis at mesoconcepts dot com
New email:
PHP Version: OS:

 

 [2007-01-11 22:42 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-12 08:29 UTC] tony2001@php.net
This is the way it works since 5.1.x and we're not going to change it again.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Mar 11 19:01:31 2025 UTC