output buffering callback limitation
| From: | Okin Okin | Date: | Wed, 09 Jun 2004 22:51:48 +0000 |
| Subject: | output buffering callback limitation | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-10358@lists.php.net to get a copy of this message | ||
Hi,
I'm having trouble with output buffering limitation
and the output_callback function of ob_start.
look at this script :
<?php
function ob_perso_handler($buffer)
{
ob_start();
echo 'foo';
$buffer .= ob_get_contents();
ob_end_clean();
return $buffer;
}
ob_start('ob_perso_handler');
echo 'Hello World !';
?>
it outputs : "Fatal error: ob_start(): Cannot use
output buffering in output buffering display handlers"
Why then ? It would be a killer feature for my next
killer appz !
I've tried also :
<?php
function ob_perso_handler1($buffer)
{
return $buffer . 'f1';
}
function ob_perso_handler2($buffer)
{
?>
foo
<?
return $buffer . 'f2';
}
ob_start('ob_perso_handler1');
ob_start('ob_perso_handler2');
echo 'Hello World !';
?>
but were does "foo" go ?
any idea on that ? maybe some source change to PHP to
permit one or the other solution ?
I'm new to this mailing list, please redirect me to
the correct one if I'm wrong here. My thought was it
was a developper problem, since change to the source
has to be done to enable such this feature ...
Many thank's for any help !
Nikos
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez Yahoo! Messenger sur http://fr.messenger.yahoo.com