Gotta love those PHP error messages
July 20, 2004
Coding Object Oriented PHP sure has its perks, one of which is the mildly amusing error message I chanced upon below (in an implementation session that turned out to be a major debugging frenzy).

A quick search reveals the cryptic error error message to mean ‘a pair of colons’ in Hebrew. You get that when you leave in an extra ‘$’ when addressing a class method, such as:
$SomeObject::someMethod();
And no class-wide static variables in pre-version 5 PHP? Does not compute…





I have done a lot of programming in PHP and I concur, that parse errors are often times very bizarre. The runtime errors which PHP generates are very informative, especially with the backtrace function in PHP 4.2.
One nice aspect of Java is that you know when you execute the program that all parse errors are gone. I wonder if there is a syntax checker written for the PHP language that would assist in checking your code for validatity. It wouldn’t be a bad idea. Then you could setup ant to run it on your project.
Posted by: Dan Allen on July 20, 2004 11pm