php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #26540 Basic Sixtax : php close tag "?>" missunderstood when it's in a commented line
Submitted: 2003-12-06 08:44 UTC Modified: 2003-12-06 11:47 UTC
From: putaso at nospam dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 4.3.3 OS: w2k
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: putaso at nospam dot com
New email:
PHP Version: OS:

 

 [2003-12-06 08:44 UTC] putaso at nospam dot com
Description:
------------
Hello, i was posing this as a Zend Engine problem, but then i found out that other people reported the same bug, and it seems that it's not gonna be fixed soon, so since i took the time to report this bug i am sendin it to you in order to see if you can explain this in the documentation:

Other people reported this misbehaviour:
- http://www.php.net/manual/en/language.basic-syntax.comments.php (20-Jan-2003 03:41)
- http://bugs.php.net/bug.php?id=5123&edit=2
- http://bugs.php.net/bug.php?id=6053&edit=2

here's my bug:
thanks..
------------------------------------------------------
I am working with Regular Expressions,
and i use the follwing one:

/(.*(?>/?)>)/s

note the "?>" chars.

The regular expression is interpreted ok.. but the problem is the following..
If i comment that line,
the php engine reads it and thin i am using this as a php close tag.

if i do:

<?php
$regular_expression = "/(.*(?>/?)>)/s";
echo $regular_expression;
?>

i get printed :
/(.*(?>/?)>)/s

but... if i comment the line with the regular expression that includes "?>", :

Reproduce code:
---------------
<?php

//$regular_expression = "/(.*(?>/?)>)/s";
$regular_expression = "/.*/s";
echo $regular_expression;

// from here on php is not code being iterpreted
echo("\n\nhello world, is this a bug?");
exit;

echo "Didn't we exit?";
//bye

?>



Expected result:
----------------
/.*/s

hello world, is this a bug?

Actual result:
--------------
/?)>)/s";
$regular_expression = "/.*/s";
echo $regular_expression;

// from here on php is not code being iterpreted
echo("\n\nhello world, is this a bug?");
exit;

echo "Didn't we exit?";
//bye

?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-06 11:47 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

RTFM, see: http://docs.php.net/en/language.basic-syntax.html#language.basic-syntax.phpmode
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 15:01:35 2025 UTC