3v4l.org

run code in 300+ PHP versions simultaneously
<?php $definition = '*@table bee\n@table aa'; preg_match_all('/\s*@table\s+([a-z]+)(?:\(\s*([^)\s]+)\s*\))?/i', $definition, $matched); switch(true) { case empty($matched[0]): throw new Exception("Table name not defined"); case (count($matched[0]) > 1): throw new Exception("Only one table name can be defined"); default: return [$matched[1][0], $matched[2][0]]; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/hljZN
function name:  (null)
number of ops:  29
compiled vars:  !0 = $definition, !1 = $matched
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2A%40table+bee%5Cn%40table+aa'
    5     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%5Cs%2A%40table%5Cs%2B%28%5Ba-z%5D%2B%29%28%3F%3A%5C%28%5Cs%2A%28%5B%5E%29%5Cs%5D%2B%29%5Cs%2A%5C%29%29%3F%2Fi'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    8     6        ISSET_ISEMPTY_DIM_OBJ                         1          !1, 0
          7      > JMPNZ                                                    ~5, ->13
   10     8    >   FETCH_DIM_R                                      ~6      !1, 0
          9        COUNT                                            ~7      ~6
         10        IS_SMALLER                                               1, ~7
         11      > JMPNZ                                                    ~8, ->17
         12    > > JMP                                                      ->21
    9    13    >   NEW                                              $9      'Exception'
         14        SEND_VAL_EX                                              'Table+name+not+defined'
         15        DO_FCALL                                      0          
         16      > THROW                                         0          $9
   11    17    >   NEW                                              $11     'Exception'
         18        SEND_VAL_EX                                              'Only+one+table+name+can+be+defined'
         19        DO_FCALL                                      0          
         20      > THROW                                         0          $11
   13    21    >   FETCH_DIM_R                                      ~13     !1, 1
         22        FETCH_DIM_R                                      ~14     ~13, 0
         23        INIT_ARRAY                                       ~15     ~14
         24        FETCH_DIM_R                                      ~16     !1, 2
         25        FETCH_DIM_R                                      ~17     ~16, 0
         26        ADD_ARRAY_ELEMENT                                ~15     ~17
         27      > RETURN                                                   ~15
   14    28*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.08 ms | 1388 KiB | 15 Q