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; echo (new b())->$foo;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qmsoH
function name:  (null)
number of ops:  12
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_CLASS                                   0  $6      ~5
          5        FETCH_STATIC_PROP_R          unknown             ~7      'foo'
          6        ECHO                                                     ~7
   16     7        NEW                                              $8      'b'
          8        DO_FCALL                                      0          
          9        FETCH_OBJ_R                                      ~10     $8, !1
         10        ECHO                                                     ~10
         11      > RETURN                                                   1

Class a:
Function getstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qmsoH
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:
166.13 ms | 1394 KiB | 13 Q