Page 1 of 1

Errors and notices

Posted: Sun 6. Jun 2004, 02:22
by taurentius
Running phpWCMS on a PHP configuration that reports all errors (E_ALL) reveals that there are quite some noticess and warnings floating around. Especially non-initialized arrays indices and 'sloppy' variable initialization checks (à la "if($var)" in stead of "if(isset($var))") seem to be omnipresent.

Perhaps this way of coding is intentional? (less memory allocation?) Would it be a good suggestion to start a branch of phpWCMS that is completely notice and error free? (in the "reporting" sense of the word, obviously) The errors and notices are not there for nothing and removing them should increase the quality of this excellent CMS.

Hopefully I haven't insulted anyone with this post, it's just that it struck me, that's all.

Posted: Sun 6. Jun 2004, 08:29
by Oliver Georgi
I have begun to remove such notices - but this goes step by step and is no "real" problem.

and the correct check is:

Code: Select all

if(isset($var) && $var) {...
"if($var)" is the shortest version to check if $var is NOT false or empty (and isset).

Oliver

Posted: Mon 7. Jun 2004, 00:19
by taurentius
That's what I meant of course :oops:

Posted: Mon 7. Jun 2004, 00:31
by Oliver Georgi
No problem ;-)