#42130 [Opn->Bgs]: Echo / Print Statements using OOP place OOP before string
| From: | johannes@php.net | Date: | Sat, 28 Jul 2007 09:11:27 +0000 |
| Subject: | #42130 [Opn->Bgs]: Echo / Print Statements using OOP place OOP before string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-115514@lists.php.net to get a copy of this message | ||
ID: 42130
Updated by: johannes@php.net
Reported By: scott at truebluewc dot com
-Status: Open
+Status: Bogus
Bug Type: *General Issues
Operating System: Linux
PHP Version: 5.2.3
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
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
.
Previous Comments:
------------------------------------------------------------------------
[2007-07-28 02:16:47] scott at truebluewc dot com
Description:
------------
When using an echo, print or a combination of those statements with an
OOP, the OOP function within an echo statement, and using an echo inside
that function, causes that function's echo to be first outputed before
the echo statement called originally. See below code.
Reproduce code:
---------------
class file - syrup.php
<?php
class syrup {
function pancakes() {
echo "syrup on my pancakes!";
}
}
?>
main file - index.php
<?php
function __autoload($classname)
{
include_once("$classname.php");
}
echo "I love ".syrup::pancakes()."<br />";
echo "and I hate ".syrup::pancakes();
echo "<br />Actually.. I can't really decide!";
?>
Expected result:
----------------
I love syrup on my pancakes!
and I hate syrup on my pancakes!
Actually.. I can't really decide!
Actual result:
--------------
syrup on my pancakes!I love
syrup on my pancakes!and I hate
Actually.. I can't really decide!
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42130&edit=1