php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36162 preg_match fails to return result matches
Submitted: 2006-01-26 11:12 UTC Modified: 2006-01-26 11:16 UTC
From: gmarik at gmail dot com Assigned:
Status: Not a bug Package: *Regular Expressions
PHP Version: 5.1.2 OS: Win XP pro 5.1.2600 rus
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: gmarik at gmail dot com
New email:
PHP Version: OS:

 

 [2006-01-26 11:12 UTC] gmarik at gmail dot com
Description:
------------
preg_match fails to return result matches in case matches variable gets assigned a value in function call statement.

Reproduce code:
---------------
<?php
preg_match('/\wte/', 'teste', $m = array());
var_dump($m);
?>

Expected result:
----------------
array(1) {
  [0]=>
  string(3) "ste"
}

Actual result:
--------------
array(0) {
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-26 11:16 UTC] tony2001@php.net
Set error_reporting to E_ALL|E_STRICT and you'll see the error message.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 11:01:30 2024 UTC