php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10311 parse error generated for comment
Submitted: 2001-04-12 15:50 UTC Modified: 2001-04-12 16:15 UTC
From: slyder at earendel dot org Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.0.4pl1 OS: Solaris 5.7
Private report: No CVE-ID: None
 [2001-04-12 15:50 UTC] slyder at earendel dot org
//$line = preg_replace("/<?[ _0-9A-Za-z\$\?\&\"\=;]+QBUYURLQ[ _0-9A-Za-z\$\?\&\"\=;]+?>/", $buyurl, $line);

ok pretend thats all one line. the problem is that when using c++ style comments, I get a parse error @ line [length of file + 1]. using c style comments makes it go away. the point of the code it was to replace the php part of a line that contained QBUYURLQ in it w/ just the url. it's no longer needed, but took a while to figure out that a comment was generating a parse error :)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-12 16:15 UTC] cnewbill@php.net
This is expected behavior.  Not a bug.

The part of the expression that is causing the problem is ?>.  Try just having // ?>, it will do the same thing.  PHP interprets this as the end of the code block.

An example of why this is so:

<?php print $value; // print value ?>

-Chris
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC