3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Toggle regex JIT: $iniSetSuccessfully = ini_set( "pcre.jit", "1" ); if ( $iniSetSuccessfully === false ) { throw new \Exception( "Unable to set pcre.jit" ); } // Test echo "\nTest with JIT enabled:\n"; preg_match( '/<(\w+)[\s\w\-]+ id="S44_i89ew">/', '<br><div id="S44_i89ew">', $matches ); var_dump( $matches ); // PCRE info ( not available on 3v4l.org ) $pcreReflector = new ReflectionExtension("pcre"); $pcreReflector->info(); $iniSetSuccessfully = ini_set( "pcre.jit", "0" ); if ( $iniSetSuccessfully === false ) { throw new \Exception( "Unable to set pcre.jit" ); } echo "\nTest with JIT disabled:\n"; // Test ( Note regex must be changed to prevent caching ) preg_match( '/<(\w+)[\s\w\-]+ id="S44_123">/', '<br><div id="S44_123">', $matches ); var_dump( $matches ); // PCRE info $pcreReflector = new ReflectionExtension("pcre"); $pcreReflector->info();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 37
Branch analysis from position: 33
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/189jh
function name:  (null)
number of ops:  53
compiled vars:  !0 = $iniSetSuccessfully, !1 = $matches, !2 = $pcreReflector
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'ini_set'
          1        SEND_VAL                                                 'pcre.jit'
          2        SEND_VAL                                                 '1'
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    5     5        TYPE_CHECK                                    4          !0
          6      > JMPZ                                                     ~5, ->11
    7     7    >   NEW                                              $6      'Exception'
          8        SEND_VAL_EX                                              'Unable+to+set+pcre.jit'
          9        DO_FCALL                                      0          
         10      > THROW                                         0          $6
   11    11    >   ECHO                                                     '%0ATest+with+JIT+enabled%3A%0A'
   12    12        INIT_FCALL                                               'preg_match'
         13        SEND_VAL                                                 '%2F%3C%28%5Cw%2B%29%5B%5Cs%5Cw%5C-%5D%2B+id%3D%22S44_i89ew%22%3E%2F'
         14        SEND_VAL                                                 '%3Cbr%3E%3Cdiv+id%3D%22S44_i89ew%22%3E'
         15        SEND_REF                                                 !1
         16        DO_ICALL                                                 
   13    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                                 
   16    20        NEW                                              $10     'ReflectionExtension'
         21        SEND_VAL_EX                                              'pcre'
         22        DO_FCALL                                      0          
         23        ASSIGN                                                   !2, $10
   17    24        INIT_METHOD_CALL                                         !2, 'info'
         25        DO_FCALL                                      0          
   20    26        INIT_FCALL                                               'ini_set'
         27        SEND_VAL                                                 'pcre.jit'
         28        SEND_VAL                                                 '0'
         29        DO_ICALL                                         $14     
         30        ASSIGN                                                   !0, $14
   21    31        TYPE_CHECK                                    4          !0
         32      > JMPZ                                                     ~16, ->37
   23    33    >   NEW                                              $17     'Exception'
         34        SEND_VAL_EX                                              'Unable+to+set+pcre.jit'
         35        DO_FCALL                                      0          
         36      > THROW                                         0          $17
   26    37    >   ECHO                                                     '%0ATest+with+JIT+disabled%3A%0A'
   28    38        INIT_FCALL                                               'preg_match'
         39        SEND_VAL                                                 '%2F%3C%28%5Cw%2B%29%5B%5Cs%5Cw%5C-%5D%2B+id%3D%22S44_123%22%3E%2F'
         40        SEND_VAL                                                 '%3Cbr%3E%3Cdiv+id%3D%22S44_123%22%3E'
         41        SEND_REF                                                 !1
         42        DO_ICALL                                                 
   29    43        INIT_FCALL                                               'var_dump'
         44        SEND_VAR                                                 !1
         45        DO_ICALL                                                 
   32    46        NEW                                              $21     'ReflectionExtension'
         47        SEND_VAL_EX                                              'pcre'
         48        DO_FCALL                                      0          
         49        ASSIGN                                                   !2, $21
   33    50        INIT_METHOD_CALL                                         !2, 'info'
         51        DO_FCALL                                      0          
         52      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.29 ms | 1005 KiB | 16 Q