|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15030 echo concatenates strings and string function call in bad order
Submitted: 2002-01-14 10:09 UTC Modified: 2002-01-14 14:25 UTC
From: ivosh at winet dot cz Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.0.6 OS: Debian Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ivosh at winet dot cz
New email:
PHP Version: OS:


 [2002-01-14 10:09 UTC] ivosh at winet dot cz
<? function Translate($R)
     { echo $R; } 
   echo "<i>".Translate("This should be in italics, but -- weird! -- it's normal.")."</i> "; ?>   


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-14 10:12 UTC]
User error, go read
 [2002-01-14 14:25 UTC]
just a short explaination: echo contatenates nothing, 
it *immediately* generates the requested output
plus arguments are evaluated before they are passed 
to a function (lets assume "echo" is a function for

so before "echo" is called the argument string is 
evaluated, for this Translate() is called, which
itself contains an echo call which is executed first now

what you wand is "return $R;" instead of "echo $R;"
in Translate()
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Jun 10 12:03:37 2023 UTC