PHP 4.0 Bug #8287: Parse error around empty() when parameter is a object member function
| From: | dbellizzi at valinux dot com | Date: | Fri, 15 Dec 2000 23:39:22 +0000 |
| Subject: | PHP 4.0 Bug #8287: Parse error around empty() when parameter is a object member function | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-41530@lists.php.net to get a copy of this message | ||
From: dbellizzi@valinux.com
Operating system: Linux 2.2.14 (debian 2.2)
PHP version: 4.0.3pl1
PHP Bug Type: Scripting Engine problem
Bug description: Parse error around empty() when parameter is a object member function
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
--
Edit Bug report at: http://bugs.php.net/?id=8287&edit=1