3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_numerics ($str) { preg_match( '/(?<=\bLevel\s)(?:[\w-]+)/is', $str, $matches); return $matches; } $one = 'aasdjhgasd asgdahjsd hjg 4ht ahsjdhkajsdhakjsdh Level 77, 100 XP Unlocked 3 Jul'; $string = "This is a string, keyword next, some more text. keyword next-word. keyword another_word. Okay, keyword do-rae-mi-fa_so_la."; print_r(get_numerics($one)); print_r(get_numerics($string));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jQo4h
function name:  (null)
number of ops:  15
compiled vars:  !0 = $one, !1 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'aasdjhgasd+asgdahjsd+hjg+4ht+ahsjdhkajsdhakjsdh+Level+77%2C+100+XP+Unlocked+3+Jul'
    9     1        ASSIGN                                                   !1, 'This+is+a+string%2C+keyword+next%2C+some+more+text.+keyword+next-word.+keyword+another_word.+Okay%2C+keyword+do-rae-mi-fa_so_la.'
   11     2        INIT_FCALL                                               'print_r'
          3        INIT_FCALL                                               'get_numerics'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
   13     8        INIT_FCALL                                               'print_r'
          9        INIT_FCALL                                               'get_numerics'
         10        SEND_VAR                                                 !1
         11        DO_FCALL                                      0  $6      
         12        SEND_VAR                                                 $6
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function get_numerics:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jQo4h
function name:  get_numerics
number of ops:  8
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%28%3F%3C%3D%5CbLevel%5Cs%29%28%3F%3A%5B%5Cw-%5D%2B%29%2Fis'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    5     6      > RETURN                                                   !1
    6     7*     > RETURN                                                   null

End of function get_numerics

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.25 ms | 1397 KiB | 19 Q