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.