Bug #15030 Updated: echo concatenates strings and string function call in bad order

From: Date: Mon, 14 Jan 2002 19:25:18 +0000
Subject: Bug #15030 Updated: echo concatenates strings and string function call in bad order
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-77046@lists.php.net to get a copy of this message
ID: 15030 Updated by: hholzgra Reported By: ivosh@winet.cz Status: Bogus Bug Type: Output Control Operating System: Debian Linux PHP Version: 4.0.6 New Comment: 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 now) 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() Previous Comments: ------------------------------------------------------------------------ [2002-01-14 10:12:27] derick@php.net User error, go read www.php.net/echo Bogus ------------------------------------------------------------------------ [2002-01-14 10:09:48] ivosh@winet.cz <? function Translate($R) { echo $R; } echo "<i>".Translate("This should be in italics, but -- weird! -- it's normal.")."</i> "; ?> ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=15030&edit=1

« previous php.dev (#77046) next »