3v4l.org

run code in 300+ PHP versions simultaneously
<?php class t { private static $configs = ["a" => ["b" => "c"]]; public static function set($name, $value) { $keyParts = explode(".", $name); $config =& self::$configs; while (!empty($keyParts)) { $key = array_shift($keyParts); if (!isset($config[$key])) { $config[$key] = []; } if (empty($keyParts)) { $config[$key] = $value; return; } $tconfig =& $config[$key]; $config = $tconfig; } } } t::set("a.b", "vittu");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cuvLf
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   INIT_STATIC_METHOD_CALL                                  't', 'set'
          1        SEND_VAL                                                 'a.b'
          2        SEND_VAL                                                 'vittu'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Class t:
Function set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 10
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 24
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 10
Branch analysis from position: 30
Branch analysis from position: 10
Branch analysis from position: 19
filename:       /in/cuvLf
function name:  set
number of ops:  31
compiled vars:  !0 = $name, !1 = $value, !2 = $keyParts, !3 = $config, !4 = $key, !5 = $tconfig
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '.'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
    9     7        FETCH_STATIC_PROP_W          unknown             $8      'configs'
          8        ASSIGN_REF                                               !3, $8
   11     9      > JMP                                                      ->27
   12    10    >   INIT_FCALL                                               'array_shift'
         11        SEND_REF                                                 !2
         12        DO_ICALL                                         $10     
         13        ASSIGN                                                   !4, $10
   14    14        ISSET_ISEMPTY_DIM_OBJ                         0  ~12     !3, !4
         15        BOOL_NOT                                         ~13     ~12
         16      > JMPZ                                                     ~13, ->19
   15    17    >   ASSIGN_DIM                                               !3, !4
         18        OP_DATA                                                  <array>
   18    19    >   ISSET_ISEMPTY_CV                                         !2
         20      > JMPZ                                                     ~15, ->24
   19    21    >   ASSIGN_DIM                                               !3, !4
         22        OP_DATA                                                  !1
   20    23      > RETURN                                                   null
   23    24    >   FETCH_DIM_W                                      $17     !3, !4
         25        ASSIGN_REF                                               !5, $17
   24    26        ASSIGN                                                   !3, !5
   11    27    >   ISSET_ISEMPTY_CV                                 ~20     !2
         28        BOOL_NOT                                         ~21     ~20
         29      > JMPNZ                                                    ~21, ->10
   26    30    > > RETURN                                                   null

End of function set

End of class t.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.16 ms | 1400 KiB | 17 Q