php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31501 preg_match generates Warning: preg_match: internal pcre_fullinfo() error -3
Submitted: 2005-01-12 00:34 UTC Modified: 2005-01-12 19:56 UTC
From: bugs dot php dot net_0 at cementhorizon dot com Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 5.0.3 OS: RedHat Enterprise Linux 3
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bugs dot php dot net_0 at cementhorizon dot com
New email:
PHP Version: OS:

 

 [2005-01-12 00:34 UTC] bugs dot php dot net_0 at cementhorizon dot com
Description:
------------
This is an extension of bug # 29914 which is an extension of bug # 29158

The first bug (bug # 29158) was bogusified by tony2001 because a whole bunch of people jumped on and added unrelated bugs to the ticket.

The second bug (bug # 29914) was bogusified by either tony2001 or derik saying "Don't use external PCRE lib, use bundled instead"

The problem is that this is a workaround not a bugfix. This is fine if one is writing new code. One just uses the bundled regex tools and avoids using preg_match. This is not acceptable if you're installing existing code, for example the current stable release of Mediawiki, which uses the preg_match function.

If you look at the php page for this function ( http://us4.php.net/manual/en/function.preg-match.php ) you can see that this is not a deprecated function or says anything about not using this under php5. It lists php5 as a version in which it's present and working.

I'm still unclear how this can be considered bogus. The bug is reproducible, it happens across multiple users, and it's a function that is part of many php projects out there.

There are more extensive details in bug # 29914

Reproduce code:
---------------
<?php
preg_match('@([0-9]{1,2}).([0-9]{1,2}).([0-9]{1,2})@', phpversion(), $match);
echo 'PHP version : '.$match[1].'-'.$match[2].'-'.$match[3];
?>

Expected result:
----------------
PHP version : 5-0-3

Actual result:
--------------
Warning: preg_match: internal pcre_fullinfo() error -3 in test.php on line 2
PHP version : --

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-12 03:38 UTC] jed@php.net
"Which" version of preg_match() to use has nothing to do with "what lib" to use. This is not a workaround at all, but a strong, clear instruction to change your behavior before using the bug system. For clarification on what a "library" is, please seek help in the support forum of your choice.

Please do NOT submit another bug about this. We "bogusify" bugs for a reason, because we know what we're doing -- Derick and Tony are two very smart individuals who would not have changed the status of the ticket if they did not have a clear reason. A bogus bug is not a clue to you to open another ticket for the same issue.

We have told you to use the bundled PCRE library before filing a bug relating to preg_match(). Easy as that.
 [2005-01-12 04:29 UTC] bugs dot php dot net_0 at cementhorizon dot com
Jed,
   Sorry I must not have been clear. I am not the guy who opened those bugs. The owner of those two bugs was admin at profvince dot com. I misunderstood what was being conveyed. I thought "Don't use external PCRE lib, use bundled instead" meant don't use functions from the PCRE extension (like preg_match, preg_replace, preg_split, etc.), use some other regexing function like strpos() or strstr(). Your saying that PHP was *built* with some other PCRE library, utilizing the "--with-pcre-regex" configure command. If you've got the ability to add stuff to either of those tickets (or mine) and maybe put something in to this effect, or at least something more descriptive than "Don't use external PCRE lib, use bundled instead" it would probably help a lot of people trying to figure out what they've done wrong. Something maybe to the effect of "When building PHP don't do so with a --with-pcre-regex=/foo/bar set to an external PCRE library, instead use the --with-pcre-regex option alone to use the built in PCRE library". Didn't mean to rile you up, just trying to figure out how to get it working. My bad.

-Gene
 [2005-01-12 05:18 UTC] jed@php.net
Please do not e-mail bug moderators directly when the same message is posted on the bug system. After all, I did read it here.

I'm not riled up, for the record.
 [2005-01-12 19:56 UTC] bugs dot php dot net_0 at cementhorizon dot com
Sure thing. Again, I'm sorry. I made a mistake. My fault. I'll try not to waste anyone else time. Thanks for your help.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 24 21:01:35 2024 UTC