3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { private static $x = 1; } class B extends A { function bar() { var_dump(self::$x); } }; class C extends A { function bar() { var_dump(A::$x); } }; $a = new B; $a->bar(); $b = new C; $b->bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4XheY
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   NEW                                                  $2      'B'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   21     3        INIT_METHOD_CALL                                             !0, 'bar'
          4        DO_FCALL                                          0          
   23     5        NEW                                                  $6      'C'
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !1, $6
   24     8        INIT_METHOD_CALL                                             !1, 'bar'
          9        DO_FCALL                                          0          
         10      > RETURN                                                       1

Class A: [no user functions]
Class B:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4XheY
function name:  bar
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                                   'var_dump'
          1        FETCH_STATIC_PROP_R              global lock         ~0      'x'
          2        SEND_VAL                                                     ~0
          3        DO_ICALL                                                     
   10     4      > RETURN                                                       null

End of function bar

End of class B.

Class C:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4XheY
function name:  bar
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                                   'var_dump'
          1        FETCH_STATIC_PROP_R              global lock         ~0      'x'
          2        SEND_VAL                                                     ~0
          3        DO_ICALL                                                     
   16     4      > RETURN                                                       null

End of function bar

End of class C.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.27 ms | 2600 KiB | 14 Q