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; print $result; 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/GohWM
function name:  (null)
number of ops:  26
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     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                                                 
   29     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                                                 
   30    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                                                 
   31    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 = 20, Position 2 = 28
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 28
2 jumps found. (Code = 77) Position 1 = 32, Position 2 = 43
Branch analysis from position: 32
2 jumps found. (Code = 78) Position 1 = 33, Position 2 = 43
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
Branch analysis from position: 28
Branch analysis from position: 16
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 28
Branch analysis from position: 20
Branch analysis from position: 28
filename:       /in/GohWM
function name:  l
number of ops:  46
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        ECHO                                                     !4
   15    19      > FE_RESET_R                                       $17     !2, ->28
         20    > > FE_FETCH_R                                               $17, !5, ->28
   17    21    >   BOOL_NOT                                         ~18     !4
         22      > JMPZ                                                     ~18, ->25
   18    23    >   FE_FREE                                                  $17
         24      > RETURN                                                   !0
   19    25    >   FETCH_DIM_R                                      ~19     !4, !5
         26        ASSIGN                                                   !4, ~19
   15    27      > JMP                                                      ->20
         28    >   FE_FREE                                                  $17
   22    29        FUNC_GET_ARGS                                    ~21     
         30        ASSIGN                                                   !6, ~21
   23    31      > FE_RESET_R                                       $23     !6, ->43
         32    > > FE_FETCH_R                                       ~24     $23, !7, ->43
         33    >   ASSIGN                                                   !5, ~24
   24    34        INIT_FCALL                                               'str_replace'
         35        NOP                                                      
         36        FAST_CONCAT                                      ~26     '%25', !5
         37        SEND_VAL                                                 ~26
         38        SEND_VAR                                                 !7
         39        SEND_VAR                                                 !4
         40        DO_ICALL                                         $27     
         41        ASSIGN                                                   !4, $27
   23    42      > JMP                                                      ->32
         43    >   FE_FREE                                                  $23
   25    44      > RETURN                                                   !4
   26    45*     > RETURN                                                   null

End of function l

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.43 ms | 1403 KiB | 25 Q