Bug #64615 [Opn->Nab]: Comment raises syntax error

From: Date: Tue, 09 Apr 2013 18:20:55 +0000
Subject: Bug #64615 [Opn->Nab]: Comment raises syntax error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-178380@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64615&edit=1 ID: 64615 Updated by: nikic@php.net Reported by: messaged at messaged dot lv Summary: Comment raises syntax error -Status: Open +Status: Not a bug Type: Bug Package: Scripting Engine problem Operating System: Ubuntu/MacOsX (x64) PHP Version: 5.3.23 Block user comment: N Private report: N New Comment: Your code contains a 0xc2a0 codeunit sequence which corresponds to a NO-BREAK SPACE (U+00A0) encoded in UTF-8. As such you do not see the character, but it is not considered a whitespace character by PHP, thus the error. Previous Comments: ------------------------------------------------------------------------ [2013-04-09 15:25:40] messaged at messaged dot lv Description: ------------ Tested following code on Ubuntu with php 5.3.22, 5.3.23 and Mac OS PHP 5.3.22. Same behaviour everywhere. MacOS php-config https://gist.github.com/message/5346478 5.3.19 affected http://codepad.viper-7.com/BJO4cL 5.4.9 http://codepad.viper-7.com/Hyju5z P.S If you going to remove line between comments then everything will work fine. Test script: --------------- <?php class Dummy { protected $key = null; public function test() { $this->key = 'value'; //Lose by exactly 1 - Half the stake is refunded.The other half is classed as a loser.   //Lose by 2 or more - All bets are losers. } } Expected result: ---------------- Nothing should happen Actual result: -------------- Parse error: syntax error, unexpected '}' in /Users/message/Dropbox/Work/syntax_error.php on line 15 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=64615&edit=1

« previous php.bugs (#178380) next »