mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00

It is done by implementing the custom stack usage. This makes the JIT with mode on more compatible with the JIT mode off. Until now, the default PCRE JIT stack was used which is 32kb big by default. There are situations where some patterns would fail with JIT while working correctly without JIT. The starting size of the JIT stack is still set to 32kb, while the max is set to the permissive 256kb (and can be increased up to 1mb). As until now no suchlike bugs regarding JIT were reported, it is expected, that the stack usage will stay by 32kb in most cases. Though providing the custom stack, applications will have more room for some sporadic stack increase, thus more compatibility.
10 lines
259 B
PHP
10 lines
259 B
PHP
--TEST--
|
|
Test preg_match() function : error conditions - jit stacklimit exhausted
|
|
--FILE--
|
|
<?php
|
|
var_dump(preg_match('/^(foo)+$/', str_repeat('foo', 1024*8192)));
|
|
var_dump(preg_last_error() === PREG_JIT_STACKLIMIT_ERROR);
|
|
?>
|
|
--EXPECT--
|
|
bool(false)
|
|
bool(true)
|