Bug #66494 [Opn->Fbk]: preg_match not working as expected
| From: | requinix@php.net | Date: | Thu, 16 Jan 2014 04:12:34 +0000 |
| Subject: | Bug #66494 [Opn->Fbk]: preg_match not working as expected | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-183832@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66494&edit=1
ID: 66494
Updated by: requinix@php.net
Reported by: daniuf at gmail dot com
Summary: preg_match not working as expected
-Status: Open
+Status: Feedback
Type: Bug
Package: PCRE related
Operating System: CentOS release 5.10 (Final)
PHP Version: 5.4.24
Block user comment: N
Private report: N
New Comment:
Works fine for me too. You're saying that if you execute that exact code with your 5.4.24 it
doesn't work? Nothing's been omitted?
Previous Comments:
------------------------------------------------------------------------
[2014-01-16 04:01:36] daniuf at gmail dot com
Description:
------------
When trying to use preg_match I'm not getting the expected result. As you can see, $chiche var
should have one element, and it's empty. I've tested same script with version 5.3.3 and
works perfectly fine. Also, I'm not getting any error, although I've setted up
error_reporting(E_ALL).
Best regards!
Test script:
---------------
<?php
error_reporting(E_ALL);
$res = "hola";
$res = preg_match("/hola/", $res, $chiche);
var_dump($chiche);
Expected result:
----------------
I expect to see :
array(1) {
[0]=>
string(4) "hola"
}
Actual result:
--------------
I see:
array(0) {
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66494&edit=1