3v4l.org

run code in 300+ PHP versions simultaneously
<?php function l($name) { $a = ["a" => "aaa", "b.a" => "123456", "a.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; $result = $result[$k]; } $args = func_get_args(); foreach($args as $k => $v) $result = str_replace("%{$k}", $v, $result); return $result; } var_dump(l("a")); var_dump(l("b.a")); var_dump(l("b.c")); var_dump(l("a.d.e", 45));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sqafU
function name:  (null)
number of ops:  26
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'l'
          2        SEND_VAL                                                 'a'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   27     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'l'
          8        SEND_VAL                                                 'b.a'
          9        DO_FCALL                                      0  $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                                 
   28    12        INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'l'
         14        SEND_VAL                                                 'b.c'
         15        DO_FCALL                                      0  $4      
         16        SEND_VAR                                                 $4
         17        DO_ICALL                                                 
   29    18        INIT_FCALL                                               'var_dump'
         19        INIT_FCALL                                               'l'
         20        SEND_VAL                                                 'a.d.e'
         21        SEND_VAL                                                 45
         22        DO_FCALL                                      0  $6      
         23        SEND_VAR                                                 $6
         24        DO_ICALL                                                 
         25      > 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 = 27
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 27
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
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 27
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 42
Branch analysis from position: 31
2 jumps found. (Code = 78) Position 1 = 32, Position 2 = 42
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
Branch analysis from position: 27
Branch analysis from position: 16
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 27
Branch analysis from position: 19
Branch analysis from position: 27
filename:       /in/sqafU
function name:  l
number of ops:  45
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, ->27
         19    > > FE_FETCH_R                                               $17, !5, ->27
   15    20    >   BOOL_NOT                                         ~18     !4
         21      > JMPZ                                                     ~18, ->24
   16    22    >   FE_FREE                                                  $17
         23      > RETURN                                                   !0
   17    24    >   FETCH_DIM_R                                      ~19     !4, !5
         25        ASSIGN                                                   !4, ~19
   13    26      > JMP                                                      ->19
         27    >   FE_FREE                                                  $17
   20    28        FUNC_GET_ARGS                                    ~21     
         29        ASSIGN                                                   !6, ~21
   21    30      > FE_RESET_R                                       $23     !6, ->42
         31    > > FE_FETCH_R                                       ~24     $23, !7, ->42
         32    >   ASSIGN                                                   !5, ~24
   22    33        INIT_FCALL                                               'str_replace'
         34        NOP                                                      
         35        FAST_CONCAT                                      ~26     '%25', !5
         36        SEND_VAL                                                 ~26
         37        SEND_VAR                                                 !7
         38        SEND_VAR                                                 !4
         39        DO_ICALL                                         $27     
         40        ASSIGN                                                   !4, $27
   21    41      > JMP                                                      ->31
         42    >   FE_FREE                                                  $23
   23    43      > RETURN                                                   !4
   24    44*     > RETURN                                                   null

End of function l

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.93 ms | 1394 KiB | 25 Q