|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-08-23 05:25 UTC] nery at astalavista dot com
if you try something like this
if(!empty($db->f("bla")))
php says there is an error of syntax
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 06 06:00:01 2026 UTC |
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 helpFrom 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. Derickwhen 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.<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.