ID:               26273
 User updated by:  tagg_maiwald at yahoo dot com
 Reported By:      tagg_maiwald at yahoo dot com
 Status:           Bogus
 Bug Type:         Feature/Change Request
 Operating System: Windows 98
 PHP Version:      4.3.4
 New Comment:

Sorry. Need more sleep.


Previous Comments:
------------------------------------------------------------------------

[2003-11-17 16:50:45] [EMAIL PROTECTED]

How is this any different from the already-implemented 
ternary operator? 
 
$sz_string .= ($bool_test) ? 'bar' : 'baz'; 
 
J 

------------------------------------------------------------------------

[2003-11-16 10:04:14] tagg_maiwald at yahoo dot com

Description:
------------
A conditional concatenator would evaluate a boolean test, then
concatenate a value onto the left operand. This operator would simplify
scripts by eliminating a kludge. The motive behind this request is to
readily construct SQL queries via PHP which can be easily reread and
understood with minimal confusion by a follow-on person maintaining the
script(s).

Reproduce code:
---------------
// kludge
$sz_string = 'foo';
if ($bool_test) { $sz_string .= 'bar'; }
else { $sz_string .= 'baz'; }
echo $sz_string

// conditional concatenator
$sz_string = 'foo';
$sz_string .? ($bool_test) 'bar' : 'baz';
echo $sz_string

Expected result:
----------------
foobar

Actual result:
--------------
foobar


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26273&edit=1

Reply via email to