|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39646 preg_match not working over https with delcared array
Submitted: 2006-11-27 16:47 UTC Modified: 2010-01-28 04:38 UTC
From: noreply at test dot com Assigned:
Status: Not a bug Package: *Regular Expressions
PHP Version: 5.2.0 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: noreply at test dot com
New email:
PHP Version: OS:


 [2006-11-27 16:47 UTC] noreply at test dot com
Very oddly, preg_match does not seem to work in some cases over https:// while it works fine over http://

See: (doesn't work) vs. (does work).

Only occurs when array is declared implicitely in function, e.g. preg_match($pat, $class, $mat=array()) does not work on  https:// while preg_match($pat, $class, $mat) works on both https:// and http://

Reproduce code:
<? $class="C11"; ?>
$pat = '/^(\D+)(\d+)$/';
if (!preg_match($pat, $class, $mat=array())) {
$digits = '';
} else {

Expected result:
Array ( [0] => C11 [1] => C [2] => 11 )

Actual result:
Array ( )


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-27 17:21 UTC]
preg_match() knows nothing about HTTP or HTTPS, there must be something else, that affect this behaviour (different data, for example).
 [2010-01-28 04:38 UTC] noreply at test dot com
Changing email.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 07:01:29 2024 UTC