|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-10-03 22:10 UTC] tony2001@php.net
[2005-10-03 23:46 UTC] nuitari at nuitari dot net
[2005-10-04 09:08 UTC] derick@php.net
[2005-10-04 13:10 UTC] nlopess@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 12:00:02 2025 UTC |
Description: ------------ If a paranthesised sub expression matches more then ~4999996 chars, no data will be inserted into the &matches array. Reducing by 1 the number in str_repeat will cause the script to work. I have tested this with PHP 4.4.0-gentoo-amd64, 5.0.4-FC4, and 5.0.5-gentoo and all exhebit the same problems. The configure line is different on all platforms. php.ini is the default. On the FC4 test there is a 512Mb memory limit. Reproduce code: --------------- <?php $xml_clean = '<data>'; $xml_clean .= str_repeat('a',4999996); $xml_clean .= '</data>'; $ret = preg_match("/(<([\w]+)[^>]*>)(.*?)(<\/\\2>)/s", $xml_clean, $match); print_r($match); ?> Expected result: ---------------- Array ( [0] => <data>aaa(...)aaa</data> [1] => <data> [2] => data [3] => aaa(...)aaa [4] => </data> ) Actual result: -------------- Array ( )