#24228 [Opn->Bgs]: ternary condition
| From: | derick@php.net | Date: | Tue, 17 Jun 2003 18:34:10 +0000 |
| Subject: | #24228 [Opn->Bgs]: ternary condition | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-42148@lists.php.net to get a copy of this message | ||
ID: 24228
Updated by: derick@php.net
Reported By: alexdg at joimail dot com
-Status: Open
+Status: Bogus
Bug Type: Unknown/Other Function
Operating System: windows xp
PHP Version: 4.3.1
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
try to add some ( and )'s
Previous Comments:
------------------------------------------------------------------------
[2003-06-17 13:33:06] alexdg at joimail dot com
Description:
------------
maybe i'm dumm, but i can't understand why the following code doesn't
work properly.
strlen($s_fnc_note) is > 45, but it echoes ' ' instead.
Reproduce code:
---------------
$s_fnc_note = 'asf asf asfda sdf asdfa sf asdf asdf asdf asdf asdf
asdf asdfasdf asdf asdfasdf asdfasdf asdfas asdfasdfasdf asdfasdf';
echo (strlen($s_fnc_note) >
45)?substr($s_fnc_note,0,42).'...':(strlen($s_fnc_note) ==
0)?' ':$s_fnc_note;
Expected result:
----------------
i do expect to echo substr($s_fnc_note,0,42).'...'
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24228&edit=1