|
Posted by Razzbar on 04/24/07 01:59
On Apr 23, 4:55 pm, Oliver Grätz <oliver.gra...@gmx.de> wrote:
> Michael Placentra II schrieb:
[...]
> > so what is really being passed to your
> > buffer() function is the return value of the last statement in the
> > function you are trying to pass to it, which may actually be the same
> > string that is being outputted.
Not what I get. Try:
function x(){
$something = 5;
}
echo x();
If I understand you, the echo should output '5'. It doesn't. I'm
glad it doesn't!
> Yep, and the output is NOT being captured but reaches the browser (or
> console) BEFORE buffer() is even called.
Clarification: If the function is only 1)declared, and 2) passed to
the
buffer function, then it it's sending its output as it's being
evaluated
in the function's parameter list. Which is not "before", but "AS" the
function is called. But I can see that's what's happening, and it
makes sense.
I like Michael's method for the simplicity, but yours is more powerful
because the buffered function can have parameters, while Michael's
doesn't seem to be able to.
[Back to original message]
|