Gotta love those PHP error messages

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).

parse error, unexpected T_PAAMAYIM_NEKUDOTAYIM


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…

14 Comments & TrackBacks ()

Paper doll icon
Dan Allen's Gravatar

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

Paper doll icon
Aaron Brazell's Gravatar

I really need to foray into OOP PHP. I am missing so much fun. :p

Posted by: Aaron Brazell on July 21, 2004 1am

Paper doll icon
Khlo's Gravatar

paamayim nekudotayim seems to be the official name of the :: notation - look at the manual:

http://uk2.php.net/manual/en/keyword.paamayim-nekudotayim.php

Wonder if it means something in some foreign language.

Posted by: Khlo on July 21, 2004 1am

Paper doll icon
Cheah Chu Yeow's Gravatar

Dan: Well, that’s one of the main premises of an interpreted language I guess. Though what you said about a syntax checker would be cool.

Aaron: Nah it’s not fun. It feels semi-broken (but mind you, I come from a Java programming background).

Khlo: Yup it means ‘a pair of colons’ in Hebrew.

Posted by: Cheah Chu Yeow on July 21, 2004 1am

Paper doll icon
Stephan Segraves's Gravatar

I know what you mean about it feeling like it’s broken… After spending a ton of time using Java and being so strict with the way I handle objects, pass values, and implement I am somewhat reluctant to give it a go in PHP.

Posted by: Stephan Segraves on July 21, 2004 2am

Paper doll icon
TeRanEX's Gravatar

There is a PHP parser that highlights syntax errors available as a plugin for jEdit (a lovely editor!), but I haven’t tried it myself yet because it needs the current development version of jEdit (4.2) and i’m using the stable version (4.1)
You can find jEdit here: http://www.jedit.org/
and the plugin here: http://plugins.jedit.org/plugins/?PHPParser

Oh, if you want to see a screenshot of jEdit: http://budts.be/weblog/item/332 (last 2 shots)

Posted by: TeRanEX on July 21, 2004 2am

Paper doll icon
jsurfer's Gravatar

The PHPeclipse Eclipse plugin contains an internal PHP parser, which should show much PHP parse errors.
But it’s not perfect at the moment.

Posted by: jsurfer on July 21, 2004 11pm

Paper doll icon
sidu's Gravatar

Just testing please dont mind it…. :)

Posted by: sidu on August 11, 2004 11pm

Paper doll icon
sidu's Gravatar

Just testing please dont mind it…. :)

Posted by: sidu on August 11, 2004 11pm

Paper doll icon
TeRanEX's Gravatar

Just to let you know:
I installed jEdit 4.2 and the PHP Parser Plugin and it really works nice. Every time you open or save a php file it is being parsed and all errors are nicely shown in an errorlist.

Posted by: TeRanEX on August 13, 2004 10am

Paper doll icon
Meitar's Gravatar

:) I’ve never seen that error myself, but it’s not at all cryptic for me: I speak Hebrew.

Posted by: Meitar on October 7, 2004 10pm

Paper doll icon
Coca IQ Bogdan's Gravatar

Yes, and something much more funny about this error, did anybody tried to set : error_reporting(0);
Because if you will do it so … you will still see the error!!! WOW!

Posted by: Coca IQ Bogdan on January 5, 2005 1pm

Paper doll icon
Cheah Chu Yeow's Gravatar

Um, I think that is because it is a fatal parse error. To stop displaying all errors, set the display_errors configuration setting in your php.ini to ‘off’ instead.

Posted by: Cheah Chu Yeow on January 5, 2005 8pm

Paper doll icon
Jeff's Gravatar

$php -l myfile.php

Will do a parser check on your file.

Posted by: Jeff on August 2, 2005 2pm

You can subscribe to the RSS feed for comments on this post.

Sorry, this entry is no longer accepting comments. If you have something you really want to say, you can write me.