3v4l.org

run code in 300+ PHP versions simultaneously
<?php class T { public function __get($property) { if (!isset($this->{$property})) { $this->{$property} = array(); } return $this->{$property}; } public function __set($key, $val) { $this->{$key} = $val; } } $testObj = new T(); $testObj->testArr; $testObj->testArr[] = 1; $testObj->testArr[] = 2; $testObj->testArr[] = 3; var_dump($testObj->testArr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1ED6K
function name:  (null)
number of ops:  19
compiled vars:  !0 = $testObj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'T'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        FETCH_OBJ_R                                      ~4      !0, 'testArr'
          4        FREE                                                     ~4
   26     5        FETCH_OBJ_W                                      $5      !0, 'testArr'
          6        ASSIGN_DIM                                               $5
          7        OP_DATA                                                  1
   27     8        FETCH_OBJ_W                                      $7      !0, 'testArr'
          9        ASSIGN_DIM                                               $7
         10        OP_DATA                                                  2
   28    11        FETCH_OBJ_W                                      $9      !0, 'testArr'
         12        ASSIGN_DIM                                               $9
         13        OP_DATA                                                  3
   30    14        INIT_FCALL                                               'var_dump'
         15        FETCH_OBJ_R                                      ~11     !0, 'testArr'
         16        SEND_VAL                                                 ~11
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Class T:
Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/1ED6K
function name:  __get
number of ops:  9
compiled vars:  !0 = $property
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        ISSET_ISEMPTY_PROP_OBJ                           ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->6
    9     4    >   ASSIGN_OBJ                                               !0
          5        OP_DATA                                                  <array>
   12     6    >   FETCH_OBJ_R                                      ~4      !0
          7      > RETURN                                                   ~4
   13     8*     > RETURN                                                   null

End of function __get

Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1ED6K
function name:  __set
number of ops:  5
compiled vars:  !0 = $key, !1 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   17     2        ASSIGN_OBJ                                               !0
          3        OP_DATA                                                  !1
   18     4      > RETURN                                                   null

End of function __set

End of class T.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
190.78 ms | 1396 KiB | 15 Q