Bug #66494 [NEW]: preg_match not working as expected

From: Date: Thu, 16 Jan 2014 04:01:36 +0000
Subject: Bug #66494 [NEW]: preg_match not working as expected
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183831@lists.php.net to get a copy of this message
From: daniuf at gmail dot com Operating system: CentOS release 5.10 (Final) PHP version: 5.4.24 Package: PCRE related Bug Type: Bug Bug description:preg_match not working as expected 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 bug report at https://bugs.php.net/bug.php?id=66494&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66494&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66494&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66494&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=66494&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=66494&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=66494&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=66494&r=needscript Try newer version: https://bugs.php.net/fix.php?id=66494&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=66494&r=support Expected behavior: https://bugs.php.net/fix.php?id=66494&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=66494&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=66494&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=66494&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66494&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=66494&r=dst IIS Stability: https://bugs.php.net/fix.php?id=66494&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=66494&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=66494&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=66494&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=66494&r=mysqlcfg

« previous php.bugs (#183831) next »