php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10066 Paser fails to report missing "}"
Submitted: 2001-03-29 17:43 UTC Modified: 2001-03-29 20:33 UTC
From: yohgaki at dd dot iij4u dot or dot jp Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.4pl1 OS: Linux/Windows
Private report: No CVE-ID: None
 [2001-03-29 17:43 UTC] yohgaki at dd dot iij4u dot or dot jp
PHP fails to report missing "}".

I could not reproduce this problem with simpler script. However, it happens on both Linux and W2K on longer script. (I think it may be easily to reproduce this problem if you get rid of "}" in 1000-2000 lines script with a lot of class definitions)

PHP4.0.4pl1 - as Apache module under Linux
PHP4.0.4RC1 - as Apache module under W2K

IE just keeps spinning or complains "no server or DNS error".

Problem happens on code like:
============
class foo{
	function bar($str) {
		switch ($str) {
			case 'a': 
				if (isset($var)) {
					echo 'No } after this line';
			break;
	}
}
============

This kind of programming error is easy to find with good editor, though. 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-29 18:16 UTC] hholzgra@php.net
what does your php.ini, especialy error_reporting look like?
 [2001-03-29 18:51 UTC] yohgaki at dd dot iij4u dot or dot jp
I should have written this. Sorry.
Error reporting is E_ALL for both W2K and Linux.

(I edited to get rid of comments, I might be messed up a little. If you need whole php.ini, please let me know)
=== php.ini (PHP4.0.5RC1 Windows Partial ini) ===
engine		=	On	
short_open_tag	=	Off
asp_tags	=	Off 
precision	=	14
y2k_compliance	=	Off
output_buffering	= Off	
output_handler		=	
zlib.output_compression = Off	
implicit_flush		= Off
allow_call_time_pass_reference	= Off	

error_reporting	=	E_ALL 	
display_errors	=	On	
display_startup_errors = On
log_errors	=	Off
track_errors	=	On
warn_plus_overloading	=	Off

variables_order		=	"GPCS"	
register_globals	=	Off
register_argc_argv	=	Off
post_max_size		=	8M

magic_quotes_gpc	=	Off
magic_quotes_runtime    =	Off	
magic_quotes_sybase	=	Off
auto_prepend_file	=
auto_append_file	=

default_mimetype = "text/html"
default_charset = "EUC-JP"

=== php.ini (PHP4.0.4pl1 Windows Partial ini) ===
engine            =    On    
short_open_tag    =    Off   
asp_tags          =    Off    
precision         =    14    
y2k_compliance    =    Off   
output_buffering  =    Off   
output_handler    =
implicit_flush    = Off
allow_call_time_pass_reference    = Off

error_reporting   =    E_ALL     
display_errors    =    On        
isplay_startup_errors = Off
log_errors        =    On
error_log         =    /var/log/php/php-error.log
track_errors      =    On
warn_plus_overloading    =    Off

variables_order      =  "EGPCS"
register_globals     =  Off
register_argc_argv   =    Off
post_max_size        =    8M
magic_quotes_gpc     =    Off
magic_quotes_runtime =    Off
magic_quotes_sybase  =    Off
auto_prepend_file    =
auto_append_file     =

default_mimetype = "text/html"
default_charset  = "EUC-JP"


 [2001-03-29 18:53 UTC] yohgaki at dd dot iij4u dot or dot jp
Oops, the latter one is php.ini for Linux/Apache/PHP4.0.4pl1
 [2001-03-29 19:09 UTC] hholzgra@php.net
do you get any error messages in apaches error_log
if you turn log_errors on?

by the way: the reason i asked for error_reporting
settings was that a lot of people re-use their
settings from php3 , usually 7 or 15 , and
miss some of the new error classes, esp. zend
parse errors by that


 [2001-03-29 19:24 UTC] yohgaki at dd dot iij4u dot or dot jp
Sorry again, I should have mention about error log.
PHP is logging parse error where it should be. It just does not show parse error on browser.

Form PHP4.0.4pl1/Apache DSO/RedHat Linux 7.0.1/ja
============================================
[30-Mar-2001 07:02:26] PHP Parse error:  parse error in /home/httpd/dev/ygb-web/include/classlib/Form.inc on line 1309
============================================
 [2001-03-29 19:33 UTC] jmoore@php.net
bogusify
 [2001-03-29 20:33 UTC] yohgaki at dd dot iij4u dot or dot jp
Ok for bogus. So I changed stuts to Closed.

It's rather easy to find what's wrong in code even if PHP does not report parse errors on browser. 

Just FYI.

I collect files that produce this problem in a single directory to test against newer PHP versions. Then PHP starts reporting errors.
 
w/o changing codes except 
require_once(INCLUDE_PATH.'file_to_include.inc'); 
to 
require_once('file_to_include.inc'); 
and other few lines need to be changed.

I thought it would be easy to reproduce this problem at first. However, it seems really hard to do. (I've also tried with other files)

Since I need to edit these files to make it work, if you need me to keep them for later reference. Please let me know ASAP, I'll left these files that causes this problem as is about 2 hours.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 00:01:30 2024 UTC