3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_numerics ($str) { preg_match('/^mom_(\d+)$/', $str, $matches); if (defined($matches[1])) return $matches[1] . "<br />"; else return "Not found <br />"; } $one = 'mom_5'; $two = 'mom_123'; $three = 'actions'; print_r(get_numerics($one)); print_r(get_numerics($two)); print_r(get_numerics($three));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SCXGE
function name:  (null)
number of ops:  22
compiled vars:  !0 = $one, !1 = $two, !2 = $three
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, 'mom_5'
   12     1        ASSIGN                                                   !1, 'mom_123'
   13     2        ASSIGN                                                   !2, 'actions'
   15     3        INIT_FCALL                                               'print_r'
          4        INIT_FCALL                                               'get_numerics'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0  $6      
          7        SEND_VAR                                                 $6
          8        DO_ICALL                                                 
   16     9        INIT_FCALL                                               'print_r'
         10        INIT_FCALL                                               'get_numerics'
         11        SEND_VAR                                                 !1
         12        DO_FCALL                                      0  $8      
         13        SEND_VAR                                                 $8
         14        DO_ICALL                                                 
   17    15        INIT_FCALL                                               'print_r'
         16        INIT_FCALL                                               'get_numerics'
         17        SEND_VAR                                                 !2
         18        DO_FCALL                                      0  $10     
         19        SEND_VAR                                                 $10
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Function get_numerics:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SCXGE
function name:  get_numerics
number of ops:  17
compiled vars:  !0 = $str, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%5Emom_%28%5Cd%2B%29%24%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    5     6        INIT_FCALL                                               'defined'
          7        FETCH_DIM_R                                      ~3      !1, 1
          8        SEND_VAL                                                 ~3
          9        DO_ICALL                                         $4      
         10      > JMPZ                                                     $4, ->15
    6    11    >   FETCH_DIM_R                                      ~5      !1, 1
         12        CONCAT                                           ~6      ~5, '%3Cbr+%2F%3E'
         13      > RETURN                                                   ~6
         14*       JMP                                                      ->16
    8    15    > > RETURN                                                   'Not+found+%3Cbr+%2F%3E'
    9    16*     > RETURN                                                   null

End of function get_numerics

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.45 ms | 1403 KiB | 22 Q