PHP 4.0 Bug #6937 Updated: Mid-string expressions not parsed properly

From: Date: Fri, 29 Sep 2000 11:13:58 +0000
Subject: PHP 4.0 Bug #6937 Updated: Mid-string expressions not parsed properly
Groups: php.dev 
Request: Send a blank email to php-dev+get-33844@lists.php.net to get a copy of this message
ID: 6937 Updated by: andi Reported By: mattw@getacard.com Status: Closed Bug Type: Scripting Engine problem Assigned To: Comments: You need to use parentheses because + and . have the same operator precedence. Previous Comments: --------------------------------------------------------------------------- [2000-09-29 06:41:55] mattw@getacard.com Duh. Of course, C doesn't have an echo() function; I meant that subexpression parsing should presumably work the same way (parentheses should not be required between neighbor arguments/concat operators). - Matt Waggoner --------------------------------------------------------------------------- [2000-09-29 06:38:17] mattw@getacard.com If $NumFixes = 2, then the following lines of code: echo("Num fixes: [" . $NumFixes - 1 . "]n"); echo("Num fixes: [" . ($NumFixes - 1) . "]n"); Produce this output: -1] Num fixes: [1] I assumed that the echo function, at least, worked the same way in PHP as it does in C. C doesn't have a concatenation operator though, and maybe this is as intended. (If it's not, then please fix it, because although the second line of code is "cleaner", the first line should work *anyway*.) - Matt Waggoner, mattw@getacard.com --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=6937

« previous php.dev (#33844) next »