3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $bar = array('aaa' => array('bbb' => 'ccc')); public function __get($value) { return $this->bar[$value]; // don't know what to implement here } } $obj = new Foo(); echo $obj->aaa['bbb']; // should return 'ccc'
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UE9oj
function name:  (null)
number of ops:  7
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   10     3        FETCH_OBJ_R                                      ~4      !0, 'aaa'
          4        FETCH_DIM_R                                      ~5      ~4, 'bbb'
          5        ECHO                                                     ~5
          6      > RETURN                                                   1

Class Foo:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UE9oj
function name:  __get
number of ops:  5
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        FETCH_OBJ_R                                      ~1      'bar'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3      > RETURN                                                   ~2
    6     4*     > RETURN                                                   null

End of function __get

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162 ms | 1393 KiB | 13 Q