An unexpected WHAT?

I’ve just been doing some PHP programming and the following error came up:

Parse error: parse error, unexpected ‘)’, expecting T_PAAMAYIM_NEKUDOTAYIM in /home/foo/bar/baz.php on line 81

Turns out that Paamayim Nekudotayim means ‘double colon’ in Hebrew and is the official name of the scope resolution operator. I guess it’s the PHP developers’ idea of a joke…

Anyway, the cause of the error in my case was a dollar sign missing from the front of a variable.

Getting NuSOAP to work in PHP5

I’ve been playing with NuSOAP (a SOAP toolkit for PHP) and had trouble getting it working under PHP5. I was getting the following error:

Fatal error: Cannot redeclare class soapclient in C:\Program Files\xampp\htdocs\dev\lib\nusoap.php on line 7240

It turns out that PHP5’s own SOAP extension uses soapclient as a class name. The easy solution is to replace all instances of soapclient in the NuSOAP library files (and your own code) with something else – I chose nusoapclient. If you use Notepad++, it’s as simple as opening all 13 source files and running a search/replace.

Procrastination

I have a rather scary exam in Formal Software Development tomorrow morning, so am finishing my last minute revision this evening. Rather than bore you with the details, here are a couple of fun stories I found on Digg earlier today:

PHP Easter Egg

Append ?=PHPE9568F36-D428-11d2-A769-00AA001ACF42 to any URL on most PHP-powered sites to see a cute picture of a dog (or a different dog, a rabbit or a guy with breadsticks up his nose, depending on the PHP version in use).

You can also use a similar technique to view the PHP and Zend logos, and the PHP credits.

There’s some more information here.

My only concern about this bit of harmless fun is that it exposes sites running PHP, but there are lots of other ways of finding this out with a default PHP installation. If you want to disable this, and other “clues”, set php_expose to Off in your PHP configuration file (php.ini) which I assume also removes other “clues” (such as PHP-specific HTTP headers). But I say: use PHP, and use it proudly. :)

(via Digg) – note that the trick no longer works on Digg URLs – the server guys did the php_expose thing!

How to cheat at Windows Pinball

The author of this article has uncovered a cheat in the 3D Pinball game bundled with Windows XP that has lain undiscovered since XP’s 2002 release. By typing the magic words “hidden test”, you are able to drag the ball around the board and do some other cheaty things. What makes it more interesting, though, is his explanation of how he unearthed the elusive cheat using debugging tools.

Apparently it only works on the XP version of the game, not the previous version which shipped on the Windows 2000 disc. However, the XP EXE should run on any version of Windows from 95 upwards. (If anyone can confirm or deny this, let me know.)

(via Digg)