|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-02-23 09:04 UTC] helly@php.net
[2007-02-23 23:26 UTC] dagdamor at simps dot ru
[2007-02-23 23:33 UTC] tony2001@php.net
[2007-02-23 23:46 UTC] dagdamor at simps dot ru
[2007-02-23 23:59 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 15:00:01 2025 UTC |
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