#29341 [Opn->Bgs]: $bar = empty(trim($foo)) ? 1 : 0 will generate error

From: Date: Thu, 22 Jul 2004 19:40:33 +0000
Subject: #29341 [Opn->Bgs]: $bar = empty(trim($foo)) ? 1 : 0 will generate error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-63369@lists.php.net to get a copy of this message
ID: 29341 Updated by: philip@php.net Reported By: victor-php at boivie dot com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: FreeBSD, Windows XP PHP Version: 5.0.0 New Comment: empty() takes on a variable, and trim($foo) is not a variable. Previous Comments: ------------------------------------------------------------------------ [2004-07-22 21:23:05] victor-php at boivie dot com 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 this bug report at http://bugs.php.net/?id=29341&edit=1

« previous php.bugs (#63369) next »