|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-12-15 18:39 UTC] dbellizzi at valinux dot com
The following script generates a parse error on line 8 (Parse error: parse error, expecting `')'' in /home/dbellizzi/cvs/crm/htdocs/test.php on line 8
<?php
class Foo {
function blah(){
return "abcd";
}
}
$foo = new Foo();
if (empty($foo->blah())){
echo("foo->blah is empty");
}
?>
However, when changed to this script that assigns the variable before checking it with empty(), it works fine:
<?php
class Foo {
function blah(){
return "blah";
}
}
$foo = new Foo();
$blah = $foo->blah();
if (empty($blah)){
echo("foo->blah is empty");
}
?>
I have duplicated this on a few different machines, but if you need information on my setup, libraries, etc. please email me and I'd be happy to provide more information
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Jul 05 16:00:01 2026 UTC |
please have a look at the manual page at http://php.net/empty "empty -- Determine whether a variable is set" empty() does only accept variables as argument. not general expressions