ID: 38766
User updated by: a at b dot c dot de
Reported By: a at b dot c dot de
Status: Wont fix
Bug Type: Feature/Change Request
Operating System: Windows XP SP2
PHP Version: 5.1.6
New Comment:
I guessed as much. Personally I blame stupid text editors for inserting
the character on the ends of lines (which is where I've found them).
Previous Comments:
------------------------------------------------------------------------
[2006-09-10 09:38:04] [EMAIL PROTECTED]
Can't do that as people using UTF8 in their scrips might use this
character as part of an identifier.
------------------------------------------------------------------------
[2006-09-10 02:19:45] a at b dot c dot de
Description:
------------
In most (Windows) fonts, character 0xa0 renders as a blank
(nonbreaking) space. Some people use text editors that for whatever
reason like to use 0xa0 at random locations instead of ordinary spaces.
The result is code that _looks_ correct, but when run can trigger a
parse error for no apparent reason.
In zend_language_scanner.l, 0xa0 is recognised as a LABEL character
(which means, among other things, that you could have a variable called
"$ ");. Assuming no-one is perverted enough to do something like that,
it should be safe to reassign it to WHITESPACE (will this cause grief
in other character sets?).
Reproduce code:
---------------
<?php
//There is an 0xa0 character immediately following the
// brace on the next line
for($i=0; $i<5; $i++){
echo "Hello, World\n";
}
?>
Expected result:
----------------
Hello, World
Hello, World
Hello, World
Hello, World
Hello, World
Actual result:
--------------
Parse error: parse error, unexpected T_ECHO in C:\test.php on line 5
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38766&edit=1