Errors and notices

Use GitHub to post bug reports and error descriptions for phpwcms. Describe your problem detailed!
Locked
taurentius
Posts: 7
Joined: Sat 5. Jun 2004, 12:33

Errors and notices

Post 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.
User avatar
Oliver Georgi
Site Admin
Posts: 9919
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
taurentius
Posts: 7
Joined: Sat 5. Jun 2004, 12:33

Post by taurentius »

That's what I meant of course :oops:
User avatar
Oliver Georgi
Site Admin
Posts: 9919
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

No problem ;-)
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Locked