Ask a Question related to PHP Bugs, Design and Development.
-
a at b dot c dot de #1
#38766 [NEW]: Nonbreaking whitespace breaks parsing
From: a at b dot c dot de
Operating system: Windows XP SP2
PHP version: 5.1.6
PHP Bug Type: Feature/Change Request
Bug description: Nonbreaking whitespace breaks parsing
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 bug report at [url]http://bugs.php.net/?id=38766&edit=1[/url]
--
Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=38766&r=trysnapshot44[/url]
Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=38766&r=trysnapshot52[/url]
Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=38766&r=trysnapshot60[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=38766&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=38766&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=38766&r=needtrace[/url]
Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=38766&r=needscript[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=38766&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=38766&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=38766&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=38766&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=38766&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=38766&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=38766&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=38766&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=38766&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=38766&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=38766&r=float[/url]
No Zend Extensions: [url]http://bugs.php.net/fix.php?id=38766&r=nozend[/url]
MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=38766&r=mysqlcfg[/url]
a at b dot c dot de Guest
-
CFC getter and whitespace
Wondering if this is a bug. Using the following code. <cfapplication name="test" sessionmanagement="yes"> <cflock timeout="20" type="exclusive"... -
Whitespace Problems
I have a form with a multi select box, when you select multiple objects it puts them in a comma delmited list. For example if you select Sheep, Cat,... -
cannot get rid of whitespace
The following code writes a file to the server, however when I check the file that it writes it starts the written code on line 2 and leaves a... -
get rid of whitespace around pipes??
On Dec 17, LoneWolf said: Then split on /\s*\|\s*/. That regex reads "zero or more whitespace, a |, then zero or more whitespace". @fields... -
Trimming Whitespace
I have a movie that imports an avi file into a cast member through script. The avi file has lots of whitespace around it. Unfortunately, when... -
derick@php.net #2
#38766 [Opn->WFx]: Nonbreaking whitespace breaks parsing
ID: 38766
Updated by: [email]derick@php.net[/email]
Reported By: a at b dot c dot de
-Status: Open
+Status: Wont fix
Bug Type: Feature/Change Request
Operating System: Windows XP SP2
PHP Version: 5.1.6
New Comment:
Can't do that as people using UTF8 in their scrips might use this
character as part of an identifier.
Previous Comments:
------------------------------------------------------------------------
[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 [url]http://bugs.php.net/?id=38766&edit=1[/url]
derick@php.net Guest
-
a at b dot c dot de #3
#38766 [WFx]: Nonbreaking whitespace breaks parsing
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]derick@php.net[/email]
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 [url]http://bugs.php.net/?id=38766&edit=1[/url]
a at b dot c dot de Guest



Reply With Quote

