|
Posted by Jerry Stuckle on 06/14/75 11:17
yawnmoth wrote:
> Say I have the following PHP script:
>
> <?
> register_shutdown_function('test');
> ob_start();
> echo "part2";
>
> function test()
> {
> $output = ob_get_contents();
> ob_end_clean();
> echo "part1<br />".$output;
> }
> ?>
>
> The output of this is part2part1<br />. Why isn't it part1<br />part2?
> register_shutdown_function should make the test function be the last
> thing that's called, just as it is in the following, shouldn't it?:
>
> <?
> ob_start();
> echo "part2";
> test();
>
> function test()
> {
> $output = ob_get_contents();
> ob_end_clean();
> echo "part1<br />".$output;
> }
> ?>
>
Maybe because test() is called when the rest of the code is complete
(shutdown)?
Looks like the correct output to me.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|