3v4l.org

run code in 300+ PHP versions simultaneously
<?php function chunk($str, $sep = ".", $index = false) { var_dump($str); $parts = explode($sep, $str); if ($index === false) return $parts[count($parts)-1]; elseif (is_numeric($index)) return $parts[$index]; else return false; } $str = 'e5yq36v365v.mp3'; var_dump(chunk($str));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eARiu
function name:  (null)
number of ops:  8
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, 'e5yq36v365v.mp3'
   15     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'chunk'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function chunk:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eARiu
function name:  chunk
number of ops:  27
compiled vars:  !0 = $str, !1 = $sep, !2 = $index, !3 = $parts
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      '.'
          2        RECV_INIT                                        !2      <false>
    4     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
    5     6        INIT_FCALL                                               'explode'
          7        SEND_VAR                                                 !1
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !3, $5
    6    11        TYPE_CHECK                                    4          !2
         12      > JMPZ                                                     ~7, ->18
    7    13    >   COUNT                                            ~8      !3
         14        SUB                                              ~9      ~8, 1
         15        FETCH_DIM_R                                      ~10     !3, ~9
         16      > RETURN                                                   ~10
         17*       JMP                                                      ->26
    8    18    >   INIT_FCALL                                               'is_numeric'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                         $11     
         21      > JMPZ                                                     $11, ->25
    9    22    >   FETCH_DIM_R                                      ~12     !3, !2
         23      > RETURN                                                   ~12
         24*       JMP                                                      ->26
   11    25    > > RETURN                                                   <false>
   12    26*     > RETURN                                                   null

End of function chunk

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.95 ms | 1399 KiB | 20 Q