#45310 [Opn->Bgs]: Unexpected $end in script that runs normally in 5.2.6

From: Date: Thu, 19 Jun 2008 07:55:34 +0000
Subject: #45310 [Opn->Bgs]: Unexpected $end in script that runs normally in 5.2.6
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-125873@lists.php.net to get a copy of this message
 ID:               45310
 User updated by:  anthony dot levensalor at gmail dot com
 Reported By:      anthony dot levensalor at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Windows Vista Business
 PHP Version:      6CVS-2008-06-19 (snap)
 New Comment:

Please disregard this submission, turns out I'm an idiot. I left a
short open tag in the code by mistake, and my 5.2.6 is configured to
allow it. Using the default short_open_tag = Off, the code was just
wrong, not the engine.

Sorry to have wasted your time.


Previous Comments:
------------------------------------------------------------------------

[2008-06-19 07:50:30] anthony dot levensalor at gmail dot com

Description:
------------
Steps to Reproduce: 
1. Browse to script on localhost in Apache 2.2 using [PHP 6.0.0-dev
(built: Jun 19 2008 02:05:40)]

2. open command window
3. Using PHP 5.2.6 (cli) (built: May  2 2008 18:02:07) "php -l
template.php"
4. Note no syntax errors found
5. Using [PHP 6.0.0-dev (cli) (built: Jun 19 2008 02:05:40)] "php -l
template.php"
6. Note 'Unexpected $end at line 41...' (1 more than actual line count
of 40 lines)

Expected result: No parse error in valid syntax.


Reproduce code:
---------------
<?php  
	@session_start();	
	require_once("../inc/ddibase.inc.php");
?>
<?php require_once("header.php"); ?>
<div id="page">
	<?php sessionStatus(); ?>
	<?php if (function_exists("submenu")) { ?>
	<div id="submenu">		
		<?php submenu(); ?>
	</div>
	<? } ?>
	<div id="content">
		<div style="margin-bottom: 20px;">
		<?php if (function_exists("main")) { main(); } ?>
		</div>
		<div>&nbsp;</div>		
	</div>
	<!-- end content -->
	<?php if (function_exists("sidebar")) { ?>
	<div id="sidebar">
		<?php sidebar(); ?>
	</div>
	<?php } ?>
	<!-- end sidebar -->
	<div style="clear: both;">&nbsp;</div>
</div>
<!-- end page -->
<?php require_once("footer.php"); ?>
</body>
</html>
<?php
	/*
		The following is the layout for the content to be written by the main
function
		<div style="margin-bottom: 20px;">
			<h1 class="title">Page Title</h1>
			<p>Page Content</p>
		</div>
	*/  
?>

Expected result:
----------------
Expected same result from 5.2.6 and 6.0.0-Dev parser given valid PHP
syntax.

Actual result:
--------------
/* Command line interop follows */

# php -l template.php
No syntax errors detected in template.php

# php -v
PHP 5.2.6 (cli) (built: May  2 2008 18:02:07)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

# c:\php6\php.exe -l template.php
PHP Parse error:  syntax error, unexpected $end in template.php on line
40

Parse error: syntax error, unexpected $end in template.php on line 40
Errors parsing template.php

# c:\php6\php -v
PHP 6.0.0-dev (cli) (built: Jun 19 2008 02:05:40)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v3.0.0-dev, Copyright (c) 1998-2008 Zend Technologies



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=45310&edit=1



Thread (2 messages)

« previous php.bugs (#125873) next »