|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-05-22 15:34 UTC] tony2001@php.net
[2005-05-22 19:13 UTC] spam at cimmanon dot org
[2005-05-23 09:13 UTC] sniper@php.net
[2005-05-31 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 16:00:02 2025 UTC |
Description: ------------ For some reason output buffering inside a callback method prevents an object's properties from being modified outside of the object. Using output buffering without a callback works as expected, though. Reproduce code: --------------- <? class foo { var $var = ''; function foo() { $this->var = 'rar'; print 'foo started<hr>'; ob_start(array(&$this, 'bar')); } function bar() { print $this->var . "<br>"; $this->var = 'asdf'; print $this->var; } } $foo = new foo; $foo->var = 'rarar'; ?> Expected result: ---------------- I expected $foo->var to be set to 'rarar' after the initial object creation via constructor, then 'asdf'. Instead, it remains set to 'rar', then 'asdf'.