php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5119 Incorrect reporting of illegal characters in code
Submitted: 2000-06-19 11:52 UTC Modified: 2000-08-17 15:51 UTC
From: webmaster at peda dot net Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0.16 OS: Linux 2.2.14-5.0 (RH6.2)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: webmaster at peda dot net
New email:
PHP Version: OS:

 

 [2000-06-19 11:52 UTC] webmaster at peda dot net
Following code demonstrates the problem. Parser doesn't complain
about illegal (unknown) character in code. Single unknown character doesn't cause error, but two illegal characters causes error. Problem is that if that illegal character is invisible in your editor it may be very very hard to notice. If there is legal code after illegal character it's reported with "Parse error: parse error in FILENAME on line XX". Note that if parser "knows" the character - for example "!" it correctly causes parser error.

PHP build with "/configure '--with-apxs=/usr/sbin/apxs' '--with-mysql=/usr/local/mysql'".

<?php
echo("Prepare for compiler error...");
# (step 2) comment the following line to fix malicious code
?
# comment - there was error I think... parser didn't notice it!
# (step 1) uncomment following to see error
#echo("oops!");
?>
<?php
# error doesn't affect following blocks - following works OK
echo("NOT");
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-17 15:51 UTC] hholzgra@php.net
in php4 you'll get a warning 

PHP Warning:  Use of undefined constant ? - assumed '?' in - on line 9

this should clarify what is going on 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 20:01:29 2024 UTC