ID: 10584
Updated by: hholzgra
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Closed
Bug Type: Scripting Engine problem
PHP Version: 4.0.5
Assigned To: 
Comments:

what you want to do is
return("1") instead of print("1")
in test()


Previous Comments:
---------------------------------------------------------------------------

[2001-05-01 14:46:54] [EMAIL PROTECTED]
Well, I would say it's counter-intuitive perhaps, but not wrong. :)

Think of it like a math expression, with parenthesis defining precedence:

             evaluated first
                  vvvv

    print( "0" . test() );

         ^              ^
         evaluated second

So the test() gets evaluated first which does it's flush(), then the rest.

(Besides, test() doesn't return anything, so printing it's result is probably wrong 
anyway.)

- Colin

---------------------------------------------------------------------------

[2001-05-01 14:21:04] [EMAIL PROTECTED]
<?php
function test() {
        print("1");
        flush();
}
print("0".test());
?>

RESULT: 10

I think thats wrong!

- Hans

---------------------------------------------------------------------------



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10584&edit=2


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to