3v4l.org

run code in 300+ PHP versions simultaneously
<?php Class Foo{ public static $StaticVariable = 42; } class Bar { private $ClassInstance; public function fn() { $this->ClassInstance = new Foo(); return $this->ClassInstance::$StaticVariable; } } $bar = new Bar; echo $bar->fn();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GabDR
function name:  (null)
number of ops:  7
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'Bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        INIT_METHOD_CALL                                         !0, 'fn'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6      > RETURN                                                   1

Class Foo: [no user functions]
Class Bar:
Function fn:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GabDR
function name:  fn
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'ClassInstance'
          3        OP_DATA                                                  $1
   12     4        FETCH_OBJ_R                                      ~3      'ClassInstance'
          5        FETCH_CLASS                                   0  $4      ~3
          6        FETCH_STATIC_PROP_R          unknown             ~5      'StaticVariable'
          7      > RETURN                                                   ~5
   13     8*     > RETURN                                                   null

End of function fn

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
193.81 ms | 1398 KiB | 13 Q