While I in no way, shape or form profess to be a php expert, I am certain that it's an actual bug, as it was discovered by Andrei Zmievski, and was reported on the Zend website.
Here's the bug report:
<b>BUG: Undefined property in class</b>
A bug in the classes structure has been spotted by Andrei Zmievski. The problem is best illustrated by his example:
<?php
error_reporting(E_ALL);
class foo {
var $bar;
}
$n = new foo;
echo $n->bar;
?>
This will return: “PHP Notice: Undefined property: bar”, with the declaration being completely ignored. This issue is currently being investigated.
And here's the report of the fix:
FIX: Undefined property in class
A fix for this issue mentioned in last week’s summary has been made by Andrei Zmievski. It will, of course, be included in the next PHP release, and can be had in a snapshot or from CVS if it is currently affecting your code.
The problem is caused when I use error_reporting(E_ALL) within the class I'm writing. When I comment out the line I can access the property in question, when I uncomment it the error re-appears.
As you can see from the report of the fix above, this issue will be addressed in the next release of PHP, but a fix can be had from CVS if it current code is being affected.
So what I'm wondering is what is it that need to be downloaded from CVS, and how can I recompile PHP on my Win2K setup such that the fix will take effect?
Thanks in advance,
Pablo