3v4l.org

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

Class XML:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 9
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/s8qd3
function name:  __CONSTRUCT
number of ops:  18
compiled vars:  !0 = $array, !1 = $val, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        ASSIGN_OBJ                                               'XML'
          2        OP_DATA                                                  !0
    6     3      > FE_RESET_R                                       $4      !0, ->16
          4    > > FE_FETCH_R                                       ~5      $4, !1, ->16
          5    >   ASSIGN                                                   !2, ~5
    7     6        ISSET_ISEMPTY_CV                                 ~7      !2
          7      > JMPZ_EX                                          ~7      ~7, ->9
          8    >   BOOL                                             ~7      !2
          9    > > JMPZ                                                     ~7, ->13
    8    10    >   ASSIGN_OBJ                                               !2
         11        OP_DATA                                                  !1
         12      > JMP                                                      ->15
   11    13    >   ASSIGN_OBJ                                               !1
         14        OP_DATA                                                  !1
    6    15    > > JMP                                                      ->4
         16    >   FE_FREE                                                  $4
   14    17      > RETURN                                                   null

End of function __construct

End of class XML.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.78 ms | 1395 KiB | 13 Q