php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31395 incorrect parsing of comments
Submitted: 2005-01-03 23:44 UTC Modified: 2005-01-03 23:53 UTC
From: marco-glatz at web dot de Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.0.2 OS: winxp
Private report: No CVE-ID: None
 [2005-01-03 23:44 UTC] marco-glatz at web dot de
Description:
------------
c-style comments are not correctly parsed if the end of the comment is inside a function-call

Reproduce code:
---------------
/*
		
$fp = fopen('foo.txt', 'w');
		
fwrite($fp, " */\n"); // php assumes comment ends here
fclose($fp);
		
*/

gives this:

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in ...

Parse error: syntax error, unexpected '"' in ... 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-03 23:53 UTC] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

See here: http://www.php.net/manual/en/language.basic-syntax.comments.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 15:01:33 2024 UTC