3v4l.org

run code in 300+ PHP versions simultaneously
<?php function Get($start, $end, $str) { $matches = array(); $regex = "/$start(.*)$end/"; preg_match_all($regex, $str, $matches); if(count($matches[1] == 1)) return $matches[1][0]; else return $matches[1]; } $str = '@XSDSDS@'; print_r(Get('@', '@', $str)); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GEi38
function name:  (null)
number of ops:  10
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, '%40XSDSDS%40'
   10     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'get'
          3        SEND_VAL                                                 '%40'
          4        SEND_VAL                                                 '%40'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0  $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                                 
   11     9      > RETURN                                                   1

Function get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GEi38
function name:  Get
number of ops:  26
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        IS_EQUAL                                         ~13     ~12, 1
         17        COUNT                                            ~14     ~13
         18      > JMPZ                                                     ~14, ->23
         19    >   FETCH_DIM_R                                      ~15     !3, 1
         20        FETCH_DIM_R                                      ~16     ~15, 0
         21      > RETURN                                                   ~16
         22*       JMP                                                      ->25
    7    23    >   FETCH_DIM_R                                      ~17     !3, 1
         24      > RETURN                                                   ~17
    8    25*     > RETURN                                                   null

End of function get

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.26 ms | 1399 KiB | 18 Q