From:
Operating system:
PHP version: Irrelevant
Package: *General Issues
Bug Type: Feature/Change Request
Bug description:Non-breaking spaces are considered as a valid identifier
character
Description:
------------
Hey :-),
Just a noticeable think that PHP allows is the use of non-breaking space
(0x00A0) as a valid identifier character. Thus, we can have very strange
code (but I love it)! See bellow.
It is not a bug, just a fact that makes PHP awesome.
Test script:
---------------
<?php
// Just for fun.
class Aa Bb Cc {
public function f g h ( ) {
var_dump('succeed (1)');
}
}
$c l a s s = new Aa Bb Cc();
$c l a s s->f g h();
// Go deeper.
function  ( ) {
var_dump('succeed (2)');
}
 ();
// Go crazy!
class  {
public function   ( ) {
var_dump('succeed (3)');
}
}
$ = new  ();
$Â ->Â Â ();
echo 'PHP is awesome :-).' . "\n";
Expected result:
----------------
string(11) "succeed (1)"
string(11) "succeed (2)"
string(11) "succeed (3)"
PHP is awesome :-).
Actual result:
--------------
string(11) "succeed (1)"
string(11) "succeed (2)"
string(11) "succeed (3)"
PHP is awesome :-).
--
Edit bug report at http://bugs.php.net/bug.php?id=53968&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53968&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53968&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=53968&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53968&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=53968&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53968&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=53968&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=53968&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=53968&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=53968&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=53968&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=53968&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=53968&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=53968&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53968&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53968&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=53968&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=53968&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=53968&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=53968&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=53968&r=mysqlcfg