|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-01-25 10:10 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 00:00:02 2025 UTC |
Description: ------------ preg_match returns errors while parsing some correct expressions, o dies with apache if there is more such "errors"... The same behaviour is both in 4.4.2 and 5.1.2 Reproduce code: --------------- $expressions = array( 1 => '/^ (?: . ){0,6} $/ix', 2 => '/^ (?: . ){0, 6} $/ix', 3 => '/^ (?: . ) {0, 6} $/ix', 4 => '/^ (?: . ) {0,6} $/ix', ); foreach ($expressions as $key => $exp) { echo $key, ": "; var_dump(preg_match($exp, '2', $pat)); var_dump($pat); echo "\n"; } Expected result: ---------------- 1: int(1) array(1) { [0]=> string(1) "2" } 2: int(1) array(1) { [0]=> string(1) "2" } 3: int(1) array(1) { [0]=> string(1) "2" } 4: int(1) array(1) { [0]=> string(1) "2" } Actual result: -------------- 1: int(1) array(1) { [0]=> string(1) "2" } 2: int(0) array(0) { } 3: int(0) array(0) { } 4: Warning: preg_match(): Compilation failed: internal error: code overflow at offs et 17 in D:\Inetpub\Projects\.php5\testrx.php on line 12 bool(false) array(0) { } ... or sometimes there is no 4: ... and apache dies...