RE: [PHP-DEV] PHP 4.0 Bug #8233: # and // don't work as comment, whereas /*..*/ do
| From: | Chris Newbill | Date: | Wed, 13 Dec 2000 19:17:46 +0000 |
| Subject: | RE: [PHP-DEV] PHP 4.0 Bug #8233: # and // don't work as comment, whereas /*..*/ do | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-41210@lists.php.net to get a copy of this message | ||
I don't have the ability to update bugs, but I can duplicate this problem.
If you escape ?> in your commented line it should work fine. ie \?\>
You can reproduce this with the following simple script. (it only happens in
logical blocks.)
<?php
if (true) {
// ?>
}
?>
By contrast this script (outside of a logical block)
<?php
//?>
?>
Would actually print "?>" to the screen
Chris
-----Original Message-----
From: stefan.peer@tiwag.co.at [mailto:stefan.peer@tiwag.co.at]
Sent: Wednesday, December 13, 2000 8:30 AM
To: php-dev@lists.php.net
Subject: [PHP-DEV] PHP 4.0 Bug #8233: # and // don't work as comment,
whereas /*..*/ do
From: stefan.peer@tiwag.co.at
Operating system: Linux Kernel 2.2.14, Apache 1.3.14
PHP version: 4.0.3pl1
PHP Bug Type: Scripting Engine problem
Bug description: # and // don't work as comment, whereas /*..*/ do
Hi, I had a problem commenting out code fragments.
The problem within the following lines is the single-line comment //
# as comment seems to have the same problem whereas /* ... */ works fine.
if( preg_match( "/(.*?)ELEMENT_(\d+)\{(.*?)\}((<.*?>)+)/",
$template_lines[$j], $matched) ){
//preg_match("/(.*?)ELEMENT_LAST\{(.*?)\}((<.*?>)+)/",
$template_lines[$j], $matched)
$debug_msg .= "Matched /(.*?)ELEMENT_(\d+)\{(.*?)\}((<.*?>)+)/ within
X";
$iterations = $matched[2];
break;
}
These lines bring up the errormessage "Parse error: parse error in
includes/functions.inc on line 408", where 408 is the last line of the file.
I am not sure, whether this has to do with commenting out regular
expressions.
By the way, I'm using Apache 1.3.14, SuSE 6.4 Linux and I've compiled php
with the following switches:
./configure --with-apache=/root/apache/apache_1.3.14
--with-mysql=/usr/local/mysql
--with-config-file-path=/usr/lib
--with-pdflib=/usr/lib/libpdf.so
--with-gdbm=/usr/lib/libgdbm.so
--enable-ftp
--enable-filepro
--with-java=/usr/lib/java
--with-ldap
--with-openssl=/usr/local/openssl
--enable-sysvsem
--enable-sysvshm
--enable-track-vars
--
Edit Bug report at: http://bugs.php.net/?id=8233&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
For additional commands, e-mail: php-dev-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net