I've been having some problems with a parse error that I can't figure
out (PHP 4.3.11 on Solaris9). Sample code:
<?php
// getting strange parse errors on this
class A {
var $value;
function A() {
$this->value = 1;
}
function getValue() {
return $this->value;
}
}
$a = new A();
if (!empty($a->getValue())) {
echo "success";
}
else {
echo "failure";
}
?>
The result of this is:
Parse error: parse error, unexpected '(', expecting ')' in
/foo/public_html/parse_errors.php on line 15
I also get the same effect with "isset", however, testing with "is_null"
or "is_int" produces the correct ("success"/"failure") result. Any ideas?
/Marcin