#25459 [Csd->Bgs]: expressions, echo/return and strings
| From: | pollita@php.net | Date: | Wed, 10 Sep 2003 05:24:56 +0000 |
| Subject: | #25459 [Csd->Bgs]: expressions, echo/return and strings | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969356252@lists.php.net to get a copy of this message | ||
ID: 25459
Updated by: pollita@php.net
Reported By: blackei2k at gmx dot de
-Status: Closed
+Status: Bogus
Bug Type: Documentation problem
PHP Version: 4.3.2
New Comment:
Nice to see you again philip, but this "bug" is 'Bogus'.
Previous Comments:
------------------------------------------------------------------------
[2003-09-09 18:47:08] philip@php.net
This is also in the faq:
http://www.php.net/manual/en/faq.using.php#faq.using.wrong-order
------------------------------------------------------------------------
[2003-09-09 17:21:05] kennyt at kennyt dot com
and that really should be '<td>' and '<td>haha</td>' :-)
------------------------------------------------------------------------
[2003-09-09 17:19:15] kennyt at kennyt dot com
function foo()
{
echo "foo";
}
this should be
function foo() {
return 'foo';
}
that's why your output isn't within the <td/> tag.
------------------------------------------------------------------------
[2003-09-09 13:35:32] blackei2k at gmx dot de
Description:
------------
I'm using the ternary operator which calls a function. The output is
not there where it should be, but a few liens above. I don't get any
errors.
Reproduce code:
---------------
function foo()
{
echo "foo";
}
...
while($obj = mysql_fetch_object($result)){
echo ($obj->id == $id ? "<td>".foo()."</td>" :
"<td>haha</td>");
}
Expected result:
----------------
that the output is where it should be.
i'm listing rows and only in one row ($obj->id == $id) is true.
the output of foo can be found dozens of lines above from where it
should be.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25459&edit=1