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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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: Sat Apr 27 22:01:28 2024 UTC