#47278 [NEW]: preg_match behaves different to version 4.4.4
| From: | franklyn dot santana at gmail dot com | Date: | Mon, 02 Feb 2009 13:44:58 +0000 |
| Subject: | #47278 [NEW]: preg_match behaves different to version 4.4.4 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-133376@lists.php.net to get a copy of this message | ||
From: franklyn dot santana at gmail dot com
Operating system: Windows 2003 Server
PHP version: 5.2.8
PHP Bug Type: *Regular Expressions
Bug description: preg_match behaves different to version 4.4.4
Description:
------------
I have a code for url rewrite, I use the preg_match function to separate
the GET parameters.
The code works fine in PHP 4.4.4, I get a matches array with the GET
parameters. But it doesn't work on PHP 5.28, the matches array is empty.
I was checking the documentation and It seems there are not changes on
this function.
Reproduce code:
---------------
$url="http://localhost/test+param-2009.html";
preg_match("/\/[^+]*\+?[^+]+\++([^-]*)-?([^-]*)-?([^-]*)-?([^-]*)-?([^-]*)-?".
"([^-]*)-?([^-]*)-?([^-]*)-?([^-]*)-?([^-]*)-?([^-]*)-?([^-]*)-?([^-]*)-?([^-]*)-?".
"([^-]*)-?([^-]*)-?([^-]*)-?([^-]*)-?([^-]*)-?([^-]*)\.html/i", $url,
$parameters);
print_r($parameters)
Expected result:
----------------
/*tested on PHP 4.4.4
Array ( [0] => //localhost/test+param-2009.html [1] => param [2] => 2009
[3] => [4] => [5] => [6] => [7] => [8] => [9] => [10] => [11] => [12]
=>
[13] => [14] => [15] => [16] => [17] => [18] => [19] => [20] => )
Actual result:
--------------
Array ( )
--
Edit bug report at http://bugs.php.net/?id=47278&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47278&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47278&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47278&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=47278&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47278&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=47278&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=47278&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=47278&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=47278&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=47278&r=support
Expected behavior: http://bugs.php.net/fix.php?id=47278&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=47278&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=47278&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=47278&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47278&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47278&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=47278&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=47278&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=47278&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=47278&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=47278&r=mysqlcfg