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);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 32
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 47
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 47
Branch analysis from position: 38
Branch analysis from position: 47
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 32
Branch analysis from position: 30
Branch analysis from position: 32
filename:       /in/W4UkB
function name:  (null)
number of ops:  51
compiled vars:  !0 = $regex, !1 = $captureOffsets, !2 = $res, !3 = $matches, !4 = $res2, !5 = $matches2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%0A++++%28%3F%3Ctypes%3E%0A++++++++%28%3F%3A%0A++++++++++++%28%3F%3A%5C%7B+%28%3F%26types%29+%5C%7D%29%0A++++++++++++%7C+%28a%29%0A++++++++%29%0A++++++++%28%5C%2A%3F%29%0A++++%29%0A'
   13     1        ASSIGN                                                   !1, <false>
   14     2        INIT_FCALL                                               'ini_set'
          3        SEND_VAL                                                 'pcre.jit'
          4        SEND_VAL                                                 '0'
          5        DO_ICALL                                                 
   15     6        INIT_FCALL                                               'preg_match'
          7        CONCAT                                           ~9      '%7B%5E', !0
          8        CONCAT                                           ~10     ~9, '%24%7Dx'
          9        SEND_VAL                                                 ~10
         10        SEND_VAL                                                 '%7Ba%7D'
         11        SEND_REF                                                 !3
         12      > JMPZ                                                     !1, ->15
         13    >   QM_ASSIGN                                        ~11     256
         14      > JMP                                                      ->16
         15    >   QM_ASSIGN                                        ~11     0
         16    >   SEND_VAL                                                 ~11
         17        DO_ICALL                                         $12     
         18        ASSIGN                                                   !2, $12
   16    19        INIT_FCALL                                               'ini_set'
         20        SEND_VAL                                                 'pcre.jit'
         21        SEND_VAL                                                 '1'
         22        DO_ICALL                                                 
   18    23        INIT_FCALL                                               'preg_match'
         24        CONCAT                                           ~15     '%7B%5E', !0
         25        CONCAT                                           ~16     ~15, '%24%7Dxx'
         26        SEND_VAL                                                 ~16
         27        SEND_VAL                                                 '%7Ba%7D'
         28        SEND_REF                                                 !5
         29      > JMPZ                                                     !1, ->32
         30    >   QM_ASSIGN                                        ~17     256
         31      > JMP                                                      ->33
         32    >   QM_ASSIGN                                        ~17     0
         33    >   SEND_VAL                                                 ~17
         34        DO_ICALL                                         $18     
         35        ASSIGN                                                   !4, $18
   20    36        IS_NOT_IDENTICAL                                         !3, !5
         37      > JMPZ                                                     ~20, ->47
   21    38    >   ECHO                                                     'without+JIT%3A%0A'
   22    39        INIT_FCALL                                               'print_r'
         40        SEND_VAR                                                 !3
         41        DO_ICALL                                                 
   23    42        ECHO                                                     '%0A'
   24    43        ECHO                                                     'with+JIT%3A%0A'
   25    44        INIT_FCALL                                               'print_r'
         45        SEND_VAR                                                 !5
         46        DO_ICALL                                                 
   27    47    >   INIT_FCALL                                               'var_dump'
         48        SEND_VAL                                                 '10.42+2022-12-12'
         49        DO_ICALL                                                 
         50      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.59 ms | 1018 KiB | 17 Q