3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex = ' (?<types> (?: (?:\{ (?&types) \}) | (a) ) (\*?) ) '; $captureOffsets = false; ini_set('pcre.jit', '0'); $res = preg_match('{^' . $regex . '$}x', '{a}', $matches, $captureOffsets ? PREG_OFFSET_CAPTURE : 0); ini_set('pcre.jit', '1'); // regex must be different to prevent regex cache, so just add 2nd "x" modifier $res2 = preg_match('{^' . $regex . '$}xx', '{a}', $matches2, $captureOffsets ? PREG_OFFSET_CAPTURE : 0); if ($matches !== $matches2) { echo 'without JIT:' . "\n"; print_r($matches); echo "\n"; echo 'with JIT:' . "\n"; print_r($matches2); } var_dump(PCRE_VERSION);
Output for git.master, git.master_jit, rfc.property-hooks
without JIT: Array ( [0] => {a} [types] => {a} [1] => {a} [2] => a [3] => ) with JIT: Array ( [0] => {a} [types] => {a} [1] => {a} [2] => [3] => ) string(16) "10.40 2022-04-14"

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
122.99 ms | 406 KiB | 5 Q