With a little PHP humor to lighten the day, Alan Knowles has suggested a new PHP 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.
Ah, if only....