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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 12:01:28 2025 UTC