Actually, no, I was wrong...
> Can you tell PHP to warn you if you use a non declared variable ? I've
> just noticed that after doing:
>> class something {
> var $a
> }
>> you can do
>> $thing = new something;
> $thing->b = adsas;
>You can *set* an undeclared variable in (or outside) a class and PHP won't
throw an error - PHP's OOP functionality is not "correct" OOP, and they've
never prentended it was. The only way it will throw an error is if you try
and /work with/ an undeclared variable, like:
if ($thing->b) {
...
}
adam
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!