3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Tree { public $children = []; public $data; public function __construct($data, $children) { $this->data = $data; $this->children = $children; } } $children1 = new Tree(34, []); $children2 = new Tree(70, []); $rootNode = new Tree(12, [$children1, $children2]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GIgDC
function name:  (null)
number of ops:  18
compiled vars:  !0 = $children1, !1 = $children2, !2 = $rootNode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $3      'Tree'
          1        SEND_VAL_EX                                              34
          2        SEND_VAL_EX                                              <array>
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
   15     5        NEW                                              $6      'Tree'
          6        SEND_VAL_EX                                              70
          7        SEND_VAL_EX                                              <array>
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $6
   17    10        NEW                                              $9      'Tree'
         11        SEND_VAL_EX                                              12
         12        INIT_ARRAY                                       ~10     !0
         13        ADD_ARRAY_ELEMENT                                ~10     !1
         14        SEND_VAL_EX                                              ~10
         15        DO_FCALL                                      0          
         16        ASSIGN                                                   !2, $9
         17      > RETURN                                                   1

Class Tree:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GIgDC
function name:  __construct
number of ops:  7
compiled vars:  !0 = $data, !1 = $children
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        ASSIGN_OBJ                                               'data'
          3        OP_DATA                                                  !0
    9     4        ASSIGN_OBJ                                               'children'
          5        OP_DATA                                                  !1
   10     6      > RETURN                                                   null

End of function __construct

End of class Tree.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.03 ms | 1398 KiB | 13 Q