3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_numerics ($str) { preg_match_all('/\d+/', $str, $matches); return $matches[0]; } $one = 'foo bar 4 baz (5 qux quux)'; $two = 'bar baz 2 bar'; $three = 'qux bar 12 quux (3 foo)'; $four = 'foo baz 3 bar (13 quux foo)'; print_r(get_numerics($one)); print_r(get_numerics($two)); print_r(get_numerics($three)); print_r(get_numerics($four));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DiDBL
function name:  (null)
number of ops:  29
compiled vars:  !0 = $one, !1 = $two, !2 = $three, !3 = $four
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'foo+bar+4+baz+%285+qux+quux%29'
    9     1        ASSIGN                                                   !1, 'bar+baz+2+bar'
   10     2        ASSIGN                                                   !2, 'qux+bar+12+quux+%283+foo%29'
   11     3        ASSIGN                                                   !3, 'foo+baz+3+bar+%2813+quux+foo%29'
   13     4        INIT_FCALL                                               'print_r'
          5        INIT_FCALL                                               'get_numerics'
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0  $8      
          8        SEND_VAR                                                 $8
          9        DO_ICALL                                                 
   14    10        INIT_FCALL                                               'print_r'
         11        INIT_FCALL                                               'get_numerics'
         12        SEND_VAR                                                 !1
         13        DO_FCALL                                      0  $10     
         14        SEND_VAR                                                 $10
         15        DO_ICALL                                                 
   15    16        INIT_FCALL                                               'print_r'
         17        INIT_FCALL                                               'get_numerics'
         18        SEND_VAR                                                 !2
         19        DO_FCALL                                      0  $12     
         20        SEND_VAR                                                 $12
         21        DO_ICALL                                                 
   16    22        INIT_FCALL                                               'print_r'
         23        INIT_FCALL                                               'get_numerics'
         24        SEND_VAR                                                 !3
         25        DO_FCALL                                      0  $14     
         26        SEND_VAR                                                 $14
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Function get_numerics:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DiDBL
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_all'
          2        SEND_VAL                                                 '%2F%5Cd%2B%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    5     6        FETCH_DIM_R                                      ~3      !1, 0
          7      > RETURN                                                   ~3
    6     8*     > RETURN                                                   null

End of function get_numerics

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
131.44 ms | 1447 KiB | 19 Q