#29341 [NEW]: $bar = empty(trim($foo)) ? 1 : 0 will generate error
| From: | victor-php at boivie dot com | Date: | Thu, 22 Jul 2004 19:23:06 +0000 |
| Subject: | #29341 [NEW]: $bar = empty(trim($foo)) ? 1 : 0 will generate error | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-63368@lists.php.net to get a copy of this message | ||
From: victor-php at boivie dot com
Operating system: FreeBSD, Windows XP
PHP version: 5.0.0
PHP Bug Type: Scripting Engine problem
Bug description: $bar = empty(trim($foo)) ? 1 : 0 will generate error
Description:
------------
Look at the reproducable code below.
Reproduce code:
---------------
$foo = ""; // Doesn't matter
$bar = empty(trim($foo)) ? 1 : 0;
echo $bar;
Expected result:
----------------
1
Actual result:
--------------
Fatal error: Can't use function return value in write context in bug.php
on line 2
--
Edit bug report at http://bugs.php.net/?id=29341&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29341&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29341&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=29341&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29341&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29341&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29341&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29341&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29341&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29341&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29341&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29341&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29341&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29341&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29341&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29341&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29341&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29341&r=float