#19064 [Com]: syntax error with '('s

From: Date: Fri, 23 Aug 2002 10:22:49 +0000
Subject: #19064 [Com]: syntax error with '('s
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17624@lists.php.net to get a copy of this message
 ID:               19064
 Comment by:       msopacua@idg.nl
 Reported By:      nery@astalavista.com
 Status:           Bogus
 Bug Type:         Compile Failure
 Operating System: -
 PHP Version:      4.2.1
 New Comment:

<quote>anyway I still think that since $db->f("bla") returns a
value</quote>

Value != variable and empty checks a variable.

The variable is the container. You check whether a bottle is empty, not
whether milking the cow produces anything.


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

[2002-08-23 05:59:10] nery@astalavista.com

when I do if ($db->f("bla")!="") it works..
when I do $tmp=$db->f("bla"); if (!empty($tmp)) it works too.

so, first: okz it can looks meaningless to do that but I need to check
if what comes over $db->f("bla") has or not an empty content. There are
several ways where it works, but the clearest one doesn't. If empty()
support or not this parameter I think is a second error, THATS NOT what
the compiler says: "parse error, unexpected '(', expecting ')'" .
agree?!

second: anyway I still think that since $db->f("bla") returns a value,
this value should be checked with empty(). it doesn't make sense you
put this value into a variable and after use this variable as a
parameter.

And this is my last post, I guess you understand my point, and you can
do what you want, or just ignore.

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

[2002-08-23 05:39:45] derick@php.net

From www.php.net/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.

$db->f("bla") is NOT a variable.

Derick

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

[2002-08-23 05:36:08] nery@astalavista.com

it comes this error
Parse error: parse error, unexpected '(', expecting ')'

where as you can see there is no error!
ITS NOT A SUPPORT QUESTION! ITS A PARSE ERROR OF PHP!! DID YOU SEE
THAT!?
I am just trying to help

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

[2002-08-23 05:32:41] cynic@php.net

Sorry, but the bug system is not the appropriate forum for asking
support questions. 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

Thank you for your interest in PHP.

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

[2002-08-23 05:25:16] nery@astalavista.com

if you try something like this

if(!empty($db->f("bla")))

php says there is an error of syntax


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


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



Thread (6 messages)

« previous php.bugs (#17624) next »