#40604 [Opn->Bgs]: Objects disappear from the global scope
| From: | helly@php.net | Date: | Fri, 23 Feb 2007 09:05:00 +0000 |
| Subject: | #40604 [Opn->Bgs]: Objects disappear from the global scope | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-109384@lists.php.net to get a copy of this message | ||
ID: 40604
Updated by: helly@php.net
Reported By: dagdamor at simps dot ru
-Status: Open
+Status: Bogus
Bug Type: Class/Object related
Operating System: Windows
PHP Version: 5.2.1
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
the object gets destroyed before you get output - well actually you
don't produce output
Previous Comments:
------------------------------------------------------------------------
[2007-02-23 08:49:07] dagdamor at simps dot ru
Description:
------------
Objects seem to disappear from the global scope when you try to access
them from the output buffer callback function. Regular variables (i.e.
not objects) don't disappear and work alright.
After some additional research I've noticed that if your PHP program
has many objects in the global scope, some of them don't disappear,
while others do. Looks very strange...
I hope this is not documentation misinterpretation, because I used
global variables, objects including in OB callbacks in PHP4, and it
worked fine. In other words, I hope this is not "You can't use global
variables there" case.
Reproduce code:
---------------
<?php
function handler($content)
{
global $obj;
return isset($obj)?"OK":"Error";
}
class MyClass {}
$obj=new MyClass();
ob_start("handler");
?>
Expected result:
----------------
OK
Actual result:
--------------
Error
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40604&edit=1