|  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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
49 + 14 = ?
Subscribe to this entry?

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

Reproduce code:
preg_match('/\wte/', 'teste', $m = array());

Expected result:
array(1) {
  string(3) "ste"

Actual result:
array(0) {


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-26 11:16 UTC]
Set error_reporting to E_ALL|E_STRICT and you'll see the error message.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Apr 01 21:03:46 2023 UTC