ID: 49333
User updated by: inf3rno dot hu at gmail dot com
Reported By: inf3rno dot hu at gmail dot com
Status: Open
Bug Type: PCRE related
Operating System: Windows XP
PHP Version: 5.2.10
New Comment:
Apache and Php reinstall didn't help. :S
Previous Comments:
------------------------------------------------------------------------
[2009-08-24 11:20:39] inf3rno dot hu at gmail dot com
Yes, I can reproduce it.
Tried with alternative text editor, but same result. So I think it's
not memory or text editor problem. (Btw. I'll test my computer's memory
soon.)
I'll try it out after a reinstall, maybe some dll files are damaged.
------------------------------------------------------------------------
[2009-08-24 08:57:07] derick@php.net
Questions asked -> Feedback mode
------------------------------------------------------------------------
[2009-08-23 10:54:45] sjoerd@php.net
Could not reproduce. When I run the code example you supplied, I get
the expected result. Are you sure you have submitted the right code
example?
------------------------------------------------------------------------
[2009-08-23 08:10:45] inf3rno dot hu at gmail dot com
Description:
------------
I developed a recursive regex pattern for compile template patterns.
During the tests I found this bug. I managed to restrict it to the
following piece of code.
The count of the numbers, and every character (\n too) counts. So if I
have 11+ characters long string in the 'y'-s block, then it's buggy, but
by 10- character long strings it works fine.
I hope it's a real bug, and not a damage in my computer. :-)
Reproduce code:
---------------
$pattern='%.*?(?:([a-z])(?:.*?(?:(?R).*?)*?\1)?|$)%sD';
$test='
x
0123456789
x
y
01234567890
y';
preg_match_all($pattern,$test,$matches,PREG_SET_ORDER);
var_dump($matches);
Expected result:
----------------
array(3) { [0]=> array(2) { [0]=> string(18) " x 0123456789 x" [1]=>
string(1) "x" } [1]=> array(2) { [0]=> string(19) " y 01234567890 y"
[1]=> string(1) "y" } [2]=> array(1) { [0]=> string(0) "" } }
Actual result:
--------------
array(0) { }
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49333&edit=1