3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test2 { public $foo = 'test'; } class test { private $arr; public function __construct() { $this->arr[0] = new test2(); $this->arr[1] = new test2(); } public function getArr() { return $this->arr; } } $t = new test(); var_dump($t->getArr()); $a = $t->getArr(); $a[0]->foo = 'bleh'; var_dump($t->getArr()); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bUYDA
function name:  (null)
number of ops:  20
compiled vars:  !0 = $t, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $2      'test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   20     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'getArr'
          5        DO_FCALL                                      0  $5      
          6        SEND_VAR                                                 $5
          7        DO_ICALL                                                 
   21     8        INIT_METHOD_CALL                                         !0, 'getArr'
          9        DO_FCALL                                      0  $7      
         10        ASSIGN                                                   !1, $7
   22    11        FETCH_DIM_W                                      $9      !1, 0
         12        ASSIGN_OBJ                                               $9, 'foo'
         13        OP_DATA                                                  'bleh'
   23    14        INIT_FCALL                                               'var_dump'
         15        INIT_METHOD_CALL                                         !0, 'getArr'
         16        DO_FCALL                                      0  $11     
         17        SEND_VAR                                                 $11
         18        DO_ICALL                                                 
   33    19      > RETURN                                                   1

Class test2: [no user functions]
Class test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bUYDA
function name:  __construct
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $2      'test2'
          1        DO_FCALL                                      0          
          2        FETCH_OBJ_W                                      $0      'arr'
          3        ASSIGN_DIM                                               $0, 0
          4        OP_DATA                                                  $2
   11     5        NEW                                              $6      'test2'
          6        DO_FCALL                                      0          
          7        FETCH_OBJ_W                                      $4      'arr'
          8        ASSIGN_DIM                                               $4, 1
          9        OP_DATA                                                  $6
   12    10      > RETURN                                                   null

End of function __construct

Function getarr:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bUYDA
function name:  getArr
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~0      'arr'
          1      > RETURN                                                   ~0
   15     2*     > RETURN                                                   null

End of function getarr

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.41 ms | 1396 KiB | 15 Q