#44486 [Opn->Bgs]: dot syntax bug

From: Date: Thu, 20 Mar 2008 02:31:52 +0000
Subject: #44486 [Opn->Bgs]: dot syntax bug
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-123500@lists.php.net to get a copy of this message
ID: 44486 Updated by: felipe@php.net Reported By: kowales at gmail dot com -Status: Open +Status: Bogus -Bug Type: Output Control +Bug Type: Scripting Engine problem Operating System: Windows XP SP2 PHP Version: 5.2.5 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 Hello, $v2 .= $v1.(!empty($v1)) ? "," : ""; is equal $v2 .= ($v1.(!empty($v1))) ? "," : ""; See the list precedence of operators, and the example about associativity in: http://docs.php.net/manual/en/language.operators.php $v2 .= $v1. (!empty($v1) ? "," : ""); It's the proper. Previous Comments: ------------------------------------------------------------------------ [2008-03-19 22:37:37] kowales at gmail dot com Description: ------------ I found error in join(dot) string syntax Reproduce code: --------------- //this works <?php $v1="blabla"; $tmp=(!empty($v1)) ? "," : ""; $v2.=$v1.$tmp; print $v2; //this should works $v1="blabla"; $v2.=$v1.(!empty($v1)) ? "," : ""; print $v2; ?> Expected result: ---------------- blabla,blabla, Actual result: -------------- ,blabla, ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44486&edit=1

« previous php.bugs (#123500) next »