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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Thu Mar 28 16:01:29 2024 UTC