3v4l.org

run code in 300+ PHP versions simultaneously
<?php $obj = new Obj; $obj->oele['boele'][] = 'foo'; print_r($obj); var_dump($obj->bar); if ( $obj->eh ); $obj->oele['foo'] = 'boele'; print_r($obj); class Obj { function __construct() { $this->foo = 'bar'; } function &__get($name) { $this->$name = null; $var = &$this->$name; switch ( $name ) { case 'bar': $var = 'magic foo'; break; } return $this->$name; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/FQZEX
function name:  (null)
number of ops:  23
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'Obj'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    5     3        FETCH_OBJ_W                                      $4      !0, 'oele'
          4        FETCH_DIM_W                                      $5      $4, 'boele'
          5        ASSIGN_DIM                                               $5
          6        OP_DATA                                                  'foo'
    6     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
    8    10        INIT_FCALL                                               'var_dump'
         11        FETCH_OBJ_R                                      ~8      !0, 'bar'
         12        SEND_VAL                                                 ~8
         13        DO_ICALL                                                 
   10    14        FETCH_OBJ_R                                      ~10     !0, 'eh'
         15      > JMPZ                                                     ~10, ->16
   12    16    >   FETCH_OBJ_W                                      $11     !0, 'oele'
         17        ASSIGN_DIM                                               $11, 'foo'
         18        OP_DATA                                                  'boele'
   13    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                                 
   32    22      > RETURN                                                   1

Class Obj:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FQZEX
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN_OBJ                                               'foo'
          1        OP_DATA                                                  'bar'
   18     2      > RETURN                                                   null

End of function __construct

Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Return found
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
filename:       /in/FQZEX
function name:  __get
number of ops:  13
compiled vars:  !0 = $name, !1 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        ASSIGN_OBJ                                               !0
          2        OP_DATA                                                  null
   22     3        FETCH_OBJ_W                                      $3      !0
          4        ASSIGN_REF                                               !1, $3
   25     5        IS_EQUAL                                                 !0, 'bar'
          6      > JMPNZ                                                    ~5, ->8
          7    > > JMP                                                      ->10
   26     8    >   ASSIGN                                                   !1, 'magic+foo'
   27     9      > JMP                                                      ->10
   30    10    >   FETCH_OBJ_W                                      $7      !0
         11      > RETURN_BY_REF                                            $7
   31    12*     > RETURN_BY_REF                                            null

End of function __get

End of class Obj.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.8 ms | 1405 KiB | 17 Q