3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_numerics ($str) { preg_match('/^mom_(\d+)$/', $str, $matches); return $matches[1]; } $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/SagJX
function name:  (null)
number of ops:  22
compiled vars:  !0 = $one, !1 = $two, !2 = $three
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'mom_5'
    9     1        ASSIGN                                                   !1, 'mom_123'
   10     2        ASSIGN                                                   !2, 'actions'
   12     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                                                 
   13     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                                                 
   14    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
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SagJX
function name:  get_numerics
number of ops:  9
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        FETCH_DIM_R                                      ~3      !1, 1
          7      > RETURN                                                   ~3
    6     8*     > RETURN                                                   null

End of function get_numerics

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.85 ms | 1399 KiB | 20 Q