3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { const RE = '~ (?(DEFINE) (?P<name> (?i) [a-z_] [-a-z_0-9]*+ ) ) ^ (?: tpl (?: / (?&name) ){3} \\.tpl | (?&name) (?: / (?&name) ){0,2}+ \\.tpl ) $ ~Dxu' ; } $r = preg_match(Foo::RE, "lorem-ipsum.tpl"); if (false === $r) { echo "Fail: ", preg_last_error(); } else { var_dump($r); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ubBtd
function name:  (null)
number of ops:  16
compiled vars:  !0 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   INIT_FCALL                                               'preg_match'
          1        SEND_VAL                                                 '%7E%0A%09%09%09%28%3F%28DEFINE%29%0A%09%09%09%09%28%3FP%3Cname%3E%0A%09%09%09%09%09%28%3Fi%29%0A%09%09%09%09%09%5Ba-z_%5D%0A%09%09%09%09%09%5B-a-z_0-9%5D%2A%2B%0A%09%09%09%09%29%0A%09%09%09%29%0A%0A%09%09%09%5E%0A%09%09%09%28%3F%3A%0A%09%09%09%09tpl%0A%09%09%09%09%28%3F%3A%0A%09%09%09%09%09%2F%0A%09%09%09%09%09%28%3F%26name%29%0A%09%09%09%09%29%7B3%7D%0A%09%09%09%09%5C.tpl%0A%09%09%09%7C%0A%09%09%09%09%28%3F%26name%29%0A%09%09%09%09%28%3F%3A%0A%09%09%09%09%09%2F%0A%09%09%09%09%09%28%3F%26name%29%0A%09%09%09%09%29%7B0%2C2%7D%2B%0A%09%09%09%09%5C.tpl%0A%09%09%09%29%0A%09%09%09%24%0A%09%09%7EDxu'
          2        SEND_VAL                                                 'lorem-ipsum.tpl'
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
   35     5        TYPE_CHECK                                    4          !0
          6      > JMPZ                                                     ~3, ->12
   36     7    >   ECHO                                                     'Fail%3A+'
          8        INIT_FCALL                                               'preg_last_error'
          9        DO_ICALL                                         $4      
         10        ECHO                                                     $4
         11      > JMP                                                      ->15
   39    12    >   INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
   40    15    > > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.87 ms | 1387 KiB | 19 Q