Bug #66494 [Fbk->Opn]: preg_match not working as expected

From: Date: Thu, 16 Jan 2014 14:43:12 +0000
Subject: Bug #66494 [Fbk->Opn]: preg_match not working as expected
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183837@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
 User updated by:    daniuf at gmail dot com
 Reported by:        daniuf at gmail dot com
 Summary:            preg_match not working as expected
-Status:             Feedback
+Status:             Open
 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:

Hi requinix.
Thanks for the quick response. Unfortunately, nothing's been omitted.


Previous Comments:
------------------------------------------------------------------------
[2014-01-16 04:12:33] requinix@php.net

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?

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


Thread (5 messages)

« previous php.bugs (#183837) next »