Annotation of embedaddon/php/ext/pcre/tests/cache_limit.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Compiled regex cache limit
! 3: --FILE--
! 4: <?php
! 5: define('PREG_CACHE_SIZE', 4096+1);
! 6:
! 7: $re = '';
! 8: $str = str_repeat('x', PREG_CACHE_SIZE);
! 9:
! 10: for ($i=0; $i < PREG_CACHE_SIZE; ++$i) {
! 11: $re .= '.';
! 12: if (!preg_match("/$re/", $str)) {
! 13: die('non match. error');
! 14: }
! 15: }
! 16:
! 17: var_dump(preg_match('/./', $str)); // this one was already deleted from the cache
! 18: var_dump(preg_match("/$re/", $str)); // but not this one
! 19:
! 20: echo "done\n";
! 21: ?>
! 22: --EXPECT--
! 23: int(1)
! 24: int(1)
! 25: done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>