[PHP-DEV] PHP 4.0 Bug #8287: Parse error around empty() when parameter is a object member function From: dbellizzi <email protected>
Date: 12/15/00

From: dbellizzi <email protected>
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

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>