From:             jeroen at unfix dot org
Operating system: any
PHP version:      5.0.3
PHP Bug Type:     Zend Engine 2 problem
Bug description:  Comment (/* */) parsing is also done inside strings

Description:
------------
Comments (/* */) are parsed wrongly. This works in most (if not all)
C-compilers, with a similar construct.

"http://www.php.net/manual/en/language.basic-syntax.comments.php"; notes:

"PHP supports 'C', 'C++' and Unix shell-style comments."

And there are two other similar bug reports (Bug #31395: incorrect parsing
of comments), and quite apparently PHP does *NOT* support C++ style
comments. If it did it would not barf at the above.

Reproduce code:
---------------
<?php

/*
 echo "*/";
*/
 echo "Blaat\n";

?>


Expected result:
----------------
Blaat

Actual result:
--------------
--- 5.0.3 ---

$ /opt/php/5.0/bin/php tst.php
PHP Parse error:  parse error, unexpected T_STRING in /tmp/tst.php on line
6
Content-type: text/html
X-Powered-By: PHP/5.0.3

--- 4.3.10-2 (debian's php4-cli 4:4.3.10-2) ---
$ php -v
PHP 4.3.10-2 (cli) (built: Dec 19 2004 03:41:45)

$ php tst.php

Parse error: parse error, unexpected T_STRING in /tmp/tst.php on line 6


-- 
Edit bug report at http://bugs.php.net/?id=31491&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31491&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31491&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31491&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31491&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31491&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31491&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31491&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31491&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31491&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31491&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31491&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31491&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31491&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31491&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31491&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31491&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31491&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31491&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31491&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31491&r=mysqlcfg

Reply via email to