3v4l.org

run code in 300+ PHP versions simultaneously
<?php class XML { public function __CONSTRUCT($array) { foreach($array as $key => $val) { if(isset($key) && $key) { $this->$key = (object) null; $obj = $this->$val; $this->$val = $obj->bindTo($this->$key); } else { $this->$val = (object) null; $obj = $this->$val; $this->$val = $obj->bindTo($this->$val, $this->$val); } } } } $array = ["database"=>["host"=>"localhost","dbname"=>"mydb","user"=>"root","password"=>""]]; $xml = new XML($array); echo($xml->{"database"}->{"host"});
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4Xpub
function name:  (null)
number of ops:  9
compiled vars:  !0 = $array, !1 = $xml
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, <array>
   19     1        NEW                                              $3      'XML'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
   20     5        FETCH_OBJ_R                                      ~6      !1, 'database'
          6        FETCH_OBJ_R                                      ~7      ~6, 'host'
          7        ECHO                                                     ~7
          8      > RETURN                                                   1

Class XML:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 37
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 37
Branch analysis from position: 3
2 jumps found. (Code = 46) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 21
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 7
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/4Xpub
function name:  __CONSTRUCT
number of ops:  39
compiled vars:  !0 = $array, !1 = $val, !2 = $key, !3 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1      > FE_RESET_R                                       $4      !0, ->37
          2    > > FE_FETCH_R                                       ~5      $4, !1, ->37
          3    >   ASSIGN                                                   !2, ~5
    5     4        ISSET_ISEMPTY_CV                                 ~7      !2
          5      > JMPZ_EX                                          ~7      ~7, ->7
          6    >   BOOL                                             ~7      !2
          7    > > JMPZ                                                     ~7, ->21
    6     8    >   CAST                                          8  ~9      null
          9        ASSIGN_OBJ                                               !2
         10        OP_DATA                                                  ~9
    7    11        FETCH_OBJ_R                                      ~10     !1
         12        ASSIGN                                                   !3, ~10
    8    13        INIT_METHOD_CALL                                         !3, 'bindTo'
         14        CHECK_FUNC_ARG                                           
         15        FETCH_OBJ_FUNC_ARG                               $13     !2
         16        SEND_FUNC_ARG                                            $13
         17        DO_FCALL                                      0  $14     
         18        ASSIGN_OBJ                                               !1
         19        OP_DATA                                                  $14
         20      > JMP                                                      ->36
   11    21    >   CAST                                          8  ~16     null
         22        ASSIGN_OBJ                                               !1
         23        OP_DATA                                                  ~16
   12    24        FETCH_OBJ_R                                      ~17     !1
         25        ASSIGN                                                   !3, ~17
   13    26        INIT_METHOD_CALL                                         !3, 'bindTo'
         27        CHECK_FUNC_ARG                                           
         28        FETCH_OBJ_FUNC_ARG                               $20     !1
         29        SEND_FUNC_ARG                                            $20
         30        CHECK_FUNC_ARG                                           
         31        FETCH_OBJ_FUNC_ARG                               $21     !1
         32        SEND_FUNC_ARG                                            $21
         33        DO_FCALL                                      0  $22     
         34        ASSIGN_OBJ                                               !1
         35        OP_DATA                                                  $22
    4    36    > > JMP                                                      ->2
         37    >   FE_FREE                                                  $4
   16    38      > RETURN                                                   null

End of function __construct

End of class XML.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.81 ms | 1399 KiB | 13 Q