3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public static $foo = 'bar'; public function getStatic(){ return self::$foo; } } class b { public $classname = 'a'; } $b = new b(); echo $b->classname->$foo;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3YWdd
function name:  (null)
number of ops:  7
compiled vars:  !0 = $b, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $2      'b'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   15     3        FETCH_OBJ_R                                      ~5      !0, 'classname'
          4        FETCH_OBJ_R                                      ~6      ~5, !1
          5        ECHO                                                     ~6
          6      > RETURN                                                   1

Class a:
Function getstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3YWdd
function name:  getStatic
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'foo'
          1      > RETURN                                                   ~0
    9     2*     > RETURN                                                   null

End of function getstatic

End of class a.

Class b: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.99 ms | 1396 KiB | 14 Q