3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getInbetweenStrings($start, $end, $str){ $matches = array(); $regex = "/$start(.*)$end/"; preg_match_all($regex, $str, $matches); return $matches[1]; } $str = "C://@@ad_cu<>><FSD>FSDFsdfsadjfa#@%@#@#''stom_attr1@@/@@upn@@/@@samaccountname@@"; $str_arr = getInbetweenStrings('@@', '@@', $str); print_r($str_arr); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XkA8C
function name:  (null)
number of ops:  11
compiled vars:  !0 = $str, !1 = $str_arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, 'C%3A%2F%2F%40%40ad_cu%3C%3E%3E%3CFSD%3EFSDFsdfsadjfa%23%40%25%40%23%40%23%27%27stom_attr1%40%40%2F%40%40upn%40%40%2F%40%40samaccountname%40%40'
   11     1        INIT_FCALL                                               'getinbetweenstrings'
          2        SEND_VAL                                                 '%40%40'
          3        SEND_VAL                                                 '%40%40'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $3      
          6        ASSIGN                                                   !1, $3
   13     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
   14    10      > RETURN                                                   1

Function getinbetweenstrings:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XkA8C
function name:  getInbetweenStrings
number of ops:  18
compiled vars:  !0 = $start, !1 = $end, !2 = $str, !3 = $matches, !4 = $regex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    3     3        ASSIGN                                                   !3, <array>
    4     4        ROPE_INIT                                     5  ~7      '%2F'
          5        ROPE_ADD                                      1  ~7      ~7, !0
          6        ROPE_ADD                                      2  ~7      ~7, '%28.%2A%29'
          7        ROPE_ADD                                      3  ~7      ~7, !1
          8        ROPE_END                                      4  ~6      ~7, '%2F'
          9        ASSIGN                                                   !4, ~6
    5    10        INIT_FCALL                                               'preg_match_all'
         11        SEND_VAR                                                 !4
         12        SEND_VAR                                                 !2
         13        SEND_REF                                                 !3
         14        DO_ICALL                                                 
    6    15        FETCH_DIM_R                                      ~12     !3, 1
         16      > RETURN                                                   ~12
    7    17*     > RETURN                                                   null

End of function getinbetweenstrings

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.18 ms | 1390 KiB | 18 Q