My problem is the following: To keep order in my scripts, I always put lots of spaces in my if-statements, like this:
if( ! isset( $_GET['user'] ) || ! isset( $_GET['user'] ) )
...
From time to time, though everything seems correct, this produces errors like “Unexpected T_STRING…” etc. Then I change the line to:
if(!isset($_GET['user'])||!isset($_GET['user']))
...
save the file, re-insert the spaces, save the file again and everything works fine. Any ideas what could cause this? Is it maybe a bug of the PHP parser?
(It’s not specifically this statement, it happens with many such spaces-including statements)
Edit: I just managed to revert the file to when it didn’t work, this is the exact code that produces the error:
if(! isset( $_GET['user'] ) || ! isset( $_GET['parent'] ) )
I also changed every character in sequence, it seems to be the space between || and !.
The error message says:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ')' in ...
You can download the file here: http://geardev.de/test.zip
This looks like a character-encoding problem. I’m not sure the exact character encoding that you’re using that is causing this, but when you open up the PHP file using a hex editor, the space character you’ve correctly identified as causing this is actually a multi-byte character

\xC2&\xA0. All other space characters are\x20as they should be:Edit:
\xC2A0is the UTF-8 way of encodingU+00A0(non-breaking space). This could have come from copying-and-pasting from a browser, a PDF, or an advanced text editor, or maybe your keyboard has Shift+Space mapped to NBSP.There have been complaints by people of Netbeans inserting NBSP randomly into their code, but I suspect this is due to the user accidentally holding Shift when typing the space.