3v4l.org

run code in 300+ PHP versions simultaneously
<?php Class MyClass { private $prop1 = "foo"; private $prop2 = "bar"; public function func1() { global $prop1; global $prop2; // by declaring global variables inside this method, it works! echo $prop1; } } $bj1 = new MyClass(); $obj1->func1();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0Z2up
function name:  (null)
number of ops:  6
compiled vars:  !0 = $bj1, !1 = $obj1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $2      'MyClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   19     3        INIT_METHOD_CALL                                         !1, 'func1'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class MyClass:
Function func1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0Z2up
function name:  func1
number of ops:  4
compiled vars:  !0 = $prop1, !1 = $prop2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   BIND_GLOBAL                                              !0, 'prop1'
   11     1        BIND_GLOBAL                                              !1, 'prop2'
   14     2        ECHO                                                     !0
   15     3      > RETURN                                                   null

End of function func1

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.88 ms | 938 KiB | 14 Q