Configuration à l'exécution

Le comportement de ces fonctions est affecté par la configuration dans le fichier php.ini.

Options de configuration PCRE
Nom Défaut Modifiable Historique
pcre.backtrack_limit "1000000" INI_ALL  
pcre.recursion_limit "100000" INI_ALL  
pcre.jit "1" INI_ALL  
Pour plus de détails sur les modes INI_*, reportez-vous à Où une directive de configuration peut être modifiée.

Voici un éclaircissement sur l'utilisation des directives de configuration.

pcre.backtrack_limit int

PCRE's backtracking limit. Par défaut à 100000 en PHP < 5.3.7.

pcre.recursion_limit int

Limite de récurrence PCRE. Notez que si vous définissez cette valeur à un nombre très élevé, vous pourriez consommer tous les processus disponibles et, éventuellement, faire planter PHP (la taille limite de la pile imposée par le système sera atteinte).

pcre.jit bool

Si la compilation PCRE "just-in-time" doit être utilisée.

add a note add a note

User Contributed Notes 2 notes

up
-6
chris at ocproducts dot com
13 years ago
pcre.backtrack_limit sets the maximum bind length PREG calls (e.g. preg_replace_callback) can make. However the actual maximum seems to be approximately half the value set here, possibly due to the character encoding that PCRE runs with internally.
up
-15
610010559 at qq dot com
4 years ago
pcre.backtrack_limit can be set to -1;
ini_set("pcre.backtrack_limit", "-1");

after i put the above code in my code, it works;
so i guess -1 means infinite(i am not very sure ,but it works);
so when you have not idea how much it should be set in your program, you can try this.
To Top