3v4l.org

run code in 300+ PHP versions simultaneously
<?php function GetBetween($content,$start,$end){ $r = explode($start, $content); if (isset($r[1])){ $r = explode($end, $r[1]); return $r[0]; } return ''; } echo GetBetween('foo test bar', 'foo', 'bar'); $var=explode('bar','foo test bar'); echo $var[0]; //print_r(explode("help","help php help program help is good")); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EucjP
function name:  (null)
number of ops:  14
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'getbetween'
          1        SEND_VAL                                                 'foo+test+bar'
          2        SEND_VAL                                                 'foo'
          3        SEND_VAL                                                 'bar'
          4        DO_FCALL                                      0  $1      
          5        ECHO                                                     $1
   12     6        INIT_FCALL                                               'explode'
          7        SEND_VAL                                                 'bar'
          8        SEND_VAL                                                 'foo+test+bar'
          9        DO_ICALL                                         $2      
         10        ASSIGN                                                   !0, $2
   13    11        FETCH_DIM_R                                      ~4      !0, 0
         12        ECHO                                                     ~4
   16    13      > RETURN                                                   1

Function getbetween:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EucjP
function name:  GetBetween
number of ops:  20
compiled vars:  !0 = $content, !1 = $start, !2 = $end, !3 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    3     3        INIT_FCALL                                               'explode'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !3, $4
    4     8        ISSET_ISEMPTY_DIM_OBJ                         0          !3, 1
          9      > JMPZ                                                     ~6, ->18
    5    10    >   INIT_FCALL                                               'explode'
         11        SEND_VAR                                                 !2
         12        FETCH_DIM_R                                      ~7      !3, 1
         13        SEND_VAL                                                 ~7
         14        DO_ICALL                                         $8      
         15        ASSIGN                                                   !3, $8
    6    16        FETCH_DIM_R                                      ~10     !3, 0
         17      > RETURN                                                   ~10
    8    18    > > RETURN                                                   ''
    9    19*     > RETURN                                                   null

End of function getbetween

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.75 ms | 1399 KiB | 16 Q