php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2321 problem with <? ... ?> in a string if line commented out
Submitted: 1999-09-18 11:37 UTC Modified: 1999-09-21 04:38 UTC
From: dnaber at mini dot gt dot owl dot de Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0.11 OS: Linux 2.2.12
Private report: No CVE-ID: None
 [1999-09-18 11:37 UTC] dnaber at mini dot gt dot owl dot de
This works fine:

<?
$var = '<? ?>';
print $var;	
?>
test

As expected, it puts out "test". But this fails:

<?
#$var = '<? ?>';
#print $var;	
?>
test

It puts out "'; #print $var; ?> test". The same happens
if you comment out with //. One can work around the problem with

#$var = '<'.'? ?'.'>';

I'll attach two possibly relevant parts of my php3.ini (it's a Suse 6.2 installation and I think I didn't change anything).

Regards
 Daniel Naber

;;;;;;;;;;;;;;;;;;;;
; Language Options ;
;;;;;;;;;;;;;;;;;;;;

engine			=	On	; enable PHP 3.0 parser
short_open_tag	=	On	; allow the <? tag.  otherwise, only <?php and <script> tags are recognized.
asp_tags		=	Off ; allow ASP-style <% %> tags
precision		=	14	; number of significant digits displayed in floating point numbers
y2k_compliance	=	Off	; whether to be year 2000 compliant (will cause problems with non y2k compliant browsers)
; Safe Mode
safe_mode		=	Off
safe_mode_exec_dir	=
; Colors for Syntax Highlighting mode.  Anything that's acceptable in <font color=???> would work.
highlight.string	=	#DD0000
highlight.comment	=	#FF8000
highlight.keyword	=	#007700
highlight.bg		=	#FFFFFF
highlight.default	=	#0000BB
highlight.html		=	#000000


;;;;;;;;;;;;;;;;;
; Data Handling ;
;;;;;;;;;;;;;;;;;
magic_quotes_gpc	=	On		; magic quotes for incoming GET/POST/Cookie data
magic_quotes_runtime=	Off		; magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_sybase	=	Off		; Use Sybase-style magic quotes (escape ' with '' instead of \')
track_vars			=	On		; enable $HTTP_GET_VARS[], $HTTP_POST_VARS[] and $HTTP_COOKIE_VARS[] arrays
; automatically add files before or after any PHP 3.0 document
auto_prepend_file	=
auto_append_file	=



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-09-21 04:38 UTC] sas at cvs dot php dot net
The behaviour you have observed is correct. Possible solutions were outlined on the mailing list.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 23:01:30 2024 UTC