3v4l.org

run code in 300+ PHP versions simultaneously
<?php function l($name) { $a = ["a" => "aaa", "b" => ["a"=>"123456"], "c" => ["d"=>["e" =>"1%1"]]]; $keys = explode(".", $name); $key = array_shift($keys); $result = isset($a[$key]) ? $a[$key] : null; foreach($keys as $k) { if(!$result) return $name; print_r($name); $result = isset($result[$k]) ? $result[$k] : null; } $args = func_get_args(); foreach($args as $k => $v) $result = str_replace("%{$k}", $v, $result); return $result; } var_dump(l("b.c"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QHMBK
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'l'
          2        SEND_VAL                                                 'b.c'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function l:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 35
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 35
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 35
2 jumps found. (Code = 77) Position 1 = 39, Position 2 = 50
Branch analysis from position: 39
2 jumps found. (Code = 78) Position 1 = 40, Position 2 = 50
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 50
Branch analysis from position: 35
Branch analysis from position: 16
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 35
Branch analysis from position: 19
Branch analysis from position: 35
filename:       /in/QHMBK
function name:  l
number of ops:  53
compiled vars:  !0 = $name, !1 = $a, !2 = $keys, !3 = $key, !4 = $result, !5 = $k, !6 = $args, !7 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        ASSIGN                                                   !1, <array>
    8     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '.'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $9      
          6        ASSIGN                                                   !2, $9
   10     7        INIT_FCALL                                               'array_shift'
          8        SEND_REF                                                 !2
          9        DO_ICALL                                         $11     
         10        ASSIGN                                                   !3, $11
   11    11        ISSET_ISEMPTY_DIM_OBJ                         0          !1, !3
         12      > JMPZ                                                     ~13, ->16
         13    >   FETCH_DIM_R                                      ~14     !1, !3
         14        QM_ASSIGN                                        ~15     ~14
         15      > JMP                                                      ->17
         16    >   QM_ASSIGN                                        ~15     null
         17    >   ASSIGN                                                   !4, ~15
   13    18      > FE_RESET_R                                       $17     !2, ->35
         19    > > FE_FETCH_R                                               $17, !5, ->35
   15    20    >   BOOL_NOT                                         ~18     !4
         21      > JMPZ                                                     ~18, ->24
   16    22    >   FE_FREE                                                  $17
         23      > RETURN                                                   !0
   17    24    >   INIT_FCALL                                               'print_r'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                                 
   18    27        ISSET_ISEMPTY_DIM_OBJ                         0          !4, !5
         28      > JMPZ                                                     ~20, ->32
         29    >   FETCH_DIM_R                                      ~21     !4, !5
         30        QM_ASSIGN                                        ~22     ~21
         31      > JMP                                                      ->33
         32    >   QM_ASSIGN                                        ~22     null
         33    >   ASSIGN                                                   !4, ~22
   13    34      > JMP                                                      ->19
         35    >   FE_FREE                                                  $17
   21    36        FUNC_GET_ARGS                                    ~24     
         37        ASSIGN                                                   !6, ~24
   22    38      > FE_RESET_R                                       $26     !6, ->50
         39    > > FE_FETCH_R                                       ~27     $26, !7, ->50
         40    >   ASSIGN                                                   !5, ~27
   23    41        INIT_FCALL                                               'str_replace'
         42        NOP                                                      
         43        FAST_CONCAT                                      ~29     '%25', !5
         44        SEND_VAL                                                 ~29
         45        SEND_VAR                                                 !7
         46        SEND_VAR                                                 !4
         47        DO_ICALL                                         $30     
         48        ASSIGN                                                   !4, $30
   22    49      > JMP                                                      ->39
         50    >   FE_FREE                                                  $26
   24    51      > RETURN                                                   !4
   25    52*     > RETURN                                                   null

End of function l

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.88 ms | 1394 KiB | 24 Q