Published 2005-02-22 10:57:28

After quite a few chats on various php-irc developer channels, it looks like PHP is going to be getting a new error_reporting level, E_ANAL.

while E_STRICT has been quite sucessfull in getting people to migrate from C# and Java, there is a sense that it is not quite complete. Apparently quite a number of them are missing their fatal exceptions on mundane issues). hence the new planned E_ANAL notices will start appearing when
  • you forget to declare a variable type before using it. (just giving it a default value doesnt count)
  • you try and do boolean tests on strings, integers, object (or anything that isnt a boolean)
  • string comparison on non-strings (although I'm tempted to suggest this for E_STRICT)
  • you declare a function (that's not part of a class)
  • you forget to put the return type of a method.
  • you forget to wrap a method call that can throw an exception in a try{ } catch block.
  • you make any property public (only available with the E_ANAL_JAVA extension).
  • any usage of PHP native array's or array functions.
  • any method call that does not involve at least 3 objects.
  • using any variable name that matches a object or method name anywhere in the imported methods or functions.
Of course while E_ANAL is regarded as esential for developing any enterprise applications, It is however highly recommended that it's turned off if you actually want to get anything done.

Developers are still open to new ideas for it.
yes - it's a joke :)
Mentioned By: : february (112 referals) : v p (33 referals) : PHP News, Views, and Community... (29 referals) : Richard@Home : Welcome :-) (17 referals) : december (17 referals) : SitePoint Forums - What methods do YOU use to debug/test your code? (15 referals) : Richard@Home : PHP - Articles and Bookmarks (12 referals) : PHP Buzz Forum - the new E_ANAL error_reporting setting (7 referals) : Archivs (ļāūņš ļāčīš) (7 referals) : E_ANAL (7 referals) : IRC Log for #peragro on, collected by PT_log-bot (5 referals) : Around the web in 80 days #4 (ļāūņš ļāčīš) (5 referals) : error_reporting (5 referals) : november (5 referals) : Max 'AMiGo' Gashkov's Journal (4 referals) : My daily fix (4 referals) : 1935713 (4 referals) : E_STRICT php (4 referals) : php E_ANAL (4 referals) : @ (4 referals)


look me a bit
It took me a bit to realize it was a joke.
#0 - ryan ( Link) on 2005-02-22 13:43:09 Delete Comment
Having a point - after all
While I usually overlook your rants about $RANDOM, I quite feel the same regarding this issue (if I didn't misunderstand the joke) :)

I thought about out-sed-ing E_STRICT errors from php-src... ;)
#1 - Mike ( Link) on 2005-02-22 16:39:11 Delete Comment
Thats Java
It is not a Joke its JEE (Java Enterprice Edition)

>ny method call that does not involve at least 3 objects.

Thats the reality in Enterprice Java Developent.

The non-existence of E_ANAL is the reason, wy we use PHP and not JEE
#2 - Mucki ( Link) on 2005-02-22 18:56:48 Delete Comment
A Classic
Thanks for brightening up a dull day :-D
#3 - Richard@Home ( Link) on 2005-02-22 21:22:04 Delete Comment
took some time
Very nice! I have to admit that I made it half through list before noticing that's a joke.
#4 - Jan Schneider ( Link) on 2005-02-23 08:19:26 Delete Comment
Actually it'd be nice if PHP would allow more "strong typing", just like the type hinting already available in PHP5, but just allow it for more uses, including class variables, and return values are good too.

Omitting the type would mean "mixed", which will be the same as current PHP behavior. But users wanting to have strong typing would be happy to have this feature.

BTW typing is not a Java thing. I came from Pascal and C, C++, they all use types. The fact that PHP was only a preprocessor and now a full-fledged programming language with broader uses, such as PHP-Gtk, makes this is actually "necessary".

And no, this isn't a joke. (and if anybody listens)
#5 - Hendy Irawan ( Link) on 2005-02-24 14:52:31 Delete Comment

Add Your Comment

Follow us on