note 23705 deleted from function.ob-start by sniper
| From: | sniper@php.net | Date: | Mon, 03 Nov 2003 15:37:04 +0000 |
| Subject: | note 23705 deleted from function.ob-start by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59696@lists.php.net to get a copy of this message | ||
Note Submitter: ben( at )dcgmail.com
----
Setting the ob_start callback to point to a method of an object (described above) will work, but the
object should be passed by reference not by value.
This may also explain why some people have had trouble doing this with some more complex objects.
<?php
class foo {
function bar($buffer) {
return "<b>$buffer</b>";
}
}
$blah = new foo;
ob_start(array(&$blah, 'bar'));
?>
Test!
<?php
ob_end_flush();
?>