|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-07-28 09:11 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 29 06:00:01 2025 UTC |
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!