php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5164 PCRE function preg_match returns null [0] in matches
Submitted: 2000-06-21 01:27 UTC Modified: 2000-08-18 21:25 UTC
From: pzb at lightningcast dot net Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0 Latest CVS (21/06/2000) OS: Linux
Private report: No CVE-ID: None
 [2000-06-21 01:27 UTC] pzb at lightningcast dot net
preg_matches is no longer putting the text that matches the full pattern in the 0th element of the 3rd parameter.  

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-21 15:40 UTC] andrei at cvs dot php dot net
I can't reproduce this. Try:

<?
preg_match("/<(.+?)>/", "<blockquote> this", $match);
var_dump($match);
?>

For me it outputs:
array(2) {
  [0]=>
  string(12) "<blockquote>"
  [1]=>
  string(10) "blockquote"
}

 [2000-08-04 11:28 UTC] stas@php.net
please confirm that this bug still exists and provide short reproducing code.
 [2000-08-18 21:25 UTC] sniper@php.net
No feedback from user.

--Jani
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 02:01:32 2024 UTC