3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test { private $x = 42; function __get($name) { $test = new Test2; return $test->$name;} } class Test2 { function __construct($arg) { $this->arg = $arg; } function __get($name) { return $this->arg->$name; } } error_reporting(E_ALL|E_NOTICE| E_STRICT); $test = new Test; var_dump($test->z);
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/kDX71
function name:  (null)
number of ops:  13
compiled vars:  !0 = $test
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   NOP                                                      
   9     1        NOP                                                      
  19     2        INIT_FCALL                                               'error_reporting'
         3        SEND_VAL                                                 32767
         4        DO_ICALL                                                 
  20     5        NEW                                              $4      :-4
         6        DO_FCALL                                      0          
         7        ASSIGN                                                   !0, $4
  21     8        INIT_FCALL                                               'var_dump'
         9        FETCH_OBJ_R                                      $7      !0, 'z'
        10        SEND_VAR                                                 $7
        11        DO_ICALL                                                 
        12      > RETURN                                                   1

Class Test:
Function __get:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/kDX71
function name:  __get
number of ops:  7
compiled vars:  !0 = $name, !1 = $test
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   RECV                                             !0      
   5     1        NEW                                              $2      :-6
         2        DO_FCALL                                      0          
         3        ASSIGN                                                   !1, $2
   6     4        FETCH_OBJ_R                                      $5      !1, !0
         5      > RETURN                                                   $5
         6*     > RETURN                                                   null

End of function __get

End of class Test.

Class Test2:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/kDX71
function name:  __construct
number of ops:  4
compiled vars:  !0 = $arg
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  10     0  E >   RECV                                             !0      
  11     1        ASSIGN_OBJ                                               'arg'
         2        OP_DATA                                                  !0
  12     3      > RETURN                                                   null

End of function __construct

Function __get:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/kDX71
function name:  __get
number of ops:  5
compiled vars:  !0 = $name
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  14     0  E >   RECV                                             !0      
  15     1        FETCH_OBJ_R                                      $1      'arg'
         2        FETCH_OBJ_R                                      $2      $1, !0
         3      > RETURN                                                   $2
  16     4*     > RETURN                                                   null

End of function __get

End of class Test2.

Generated using Vulcan Logic Dumper, using php 7.1.0