ID: 36939 Updated by: [EMAIL PROTECTED] Reported By: jmichae3 at yahoo dot com -Status: Open +Status: Feedback Bug Type: Scripting Engine problem Operating System: Windows XP Pro MP PHP Version: 5.1.2 New Comment:
Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. I'm sure to test the syntax we don't need any huge scripts in zip archive. Previous Comments: ------------------------------------------------------------------------ [2006-04-01 08:10:57] jmichae3 at yahoo dot com Description: ------------ PHP gives "unexpected T_ELSE" and "unexpected T_CASE" errors on valid code. checked the code over with brace checker and dreamweaver 8 and older versions of PHP for correctness. maybe it has something to do with the structure of my if/else/switch statements and my weaving in and out of the PHP interpreter. The rest of my 40+ files are fine. just these 2 give me errors in the same place consistently. Reproduce code: --------------- http://mmediap3.home.comcast.net/z/phpprob.zip includes include files header.php and dbinc.php you may need to execute a short script with header.php in it and a line to set $_SESSION['tid']=1; for tareports.php to output XHTML. execute script from command-line. (executing this script just caused PHP to hang and not die this time (?!?)) Expected result: ---------------- error messaged about $_SERVER[REMOTE_ADDR] not being defined. and maybe some messages about some session variables not being defined, ad a lot of XHTML. if $_SESSION[tid] is not defined, no XHTML. and if the tables aren't defined on your box (MySQL sql script included), probably mysql errors. Actual result: -------------- older versions of PHP output XHTML (or hang). C:\prj>php tareports.php PHP Parse error: parse error, unexpected T_ELSE in tareports.php on line 211 causes PHP crash with stack trace outlined below. When I comment this else block out, it complains about the next else. when I comment *that* out, it complains about the case statement that comes next. sounds to me like the parser's in an odd state, or some pointer or piece of memory got mangled. C:\prj>php userreports.php PHP Parse error: syntax error, unexpected T_CASE in userreports.php on line 285 which causes an Access Violation. Actually, all errors cause an Access Violation in this debug version. Stack trace: 014d1c80() tsrm_shutdown() line 180 + 4 bytes main(int, char * *) line 1258 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36939&edit=1