Re: if (empty(trim('x'))) == parse error?
From the docs for empty():
"Note that this is meaningless when used on anything which isn't a
variable; i.e. empty (addslashes ($name)) has
no meaning since it would be checking whether something which isn't a variable is a variable
with a FALSE value. "
Regards,
Andrey Hristov
----- Original Message -----
From: "Holger Schopohl" <poiujkl@gmx.de>
To: <php-dev@lists.php.net>
Sent: Wednesday, November 28, 2001 11:15 AM
Subject: [PHP-DEV] if (empty(trim('x'))) == parse error?
> Hi,
>
> why php results a parse error on this expression?
>
> if (empty(trim('x'))) echo "Hello";
>
> the statement works fine:
> $x=trim('x');
> if (empty($x)) echo "Hello";
>
> it is not really logically.
>
> Regards,
>
> Holger
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
Thread (3 messages)