ID: 39334
Updated by: [email]johannes@php.net[/email]
Reported By: sw4u at gmx dot net
-Status: Open
+Status: Bogus
Bug Type: Variables related
Operating System: Debian Linux 3.1
PHP Version: 4.4.4
New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
[url]http://www.php.net/manual/[/url] and the instructions on how to report
a bug at [url]http://bugs.php.net/how-to-report.php[/url]

Please check the operator precedence and use parenthesis. See
php.net/operator


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

[2006-11-01 14:47:07] sw4u at gmx dot net

Description:
------------
Only the last var in an if statement with function call is returned as
expected. The other types are changed to bool.

Debian Linux 3.1
Server API Apache 2.0 Handler
Default Debian installation
Apache/2.0.54 (Debian GNU/Linux) PHP/4.3.10-16


Reproduce code:
---------------
<?php

function test($string){
return ($string);
}

if( $a = test("a") && $b = test("b") && $c = test("c") ){
echo $a;
echo $b;
echo $c;
}

?>


Expected result:
----------------
abc

Actual result:
--------------
11c


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


--
Edit this bug report at [url]http://bugs.php.net/?id=39334&edit=1[/url]