3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ static $default="A::default "; public static $public="A::public "; protected static $protected="A::protected "; private static $private="A::private "; function test(){ echo $this::$default; echo $this::$public; echo static::$protected; echo static::$private;//error } } class B extends A{ static $default="B::default "; public static $public="B::public "; protected static $protected="B::protected "; private static $private="B::private "; } $obj = new B; $obj->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KXeNn
function name:  (null)
number of ops:  6
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class A:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KXeNn
function name:  test
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_THIS                                       ~0      
          1        FETCH_CLASS                                   0  $1      ~0
          2        FETCH_STATIC_PROP_R          unknown             ~2      'default'
          3        ECHO                                                     ~2
   10     4        FETCH_THIS                                       ~3      
          5        FETCH_CLASS                                   0  $4      ~3
          6        FETCH_STATIC_PROP_R          unknown             ~5      'public'
          7        ECHO                                                     ~5
   11     8        FETCH_STATIC_PROP_R          unknown             ~6      'protected'
          9        ECHO                                                     ~6
   12    10        FETCH_STATIC_PROP_R          unknown             ~7      'private'
         11        ECHO                                                     ~7
   13    12      > RETURN                                                   null

End of function test

End of class A.

Class B:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KXeNn
function name:  test
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_THIS                                       ~0      
          1        FETCH_CLASS                                   0  $1      ~0
          2        FETCH_STATIC_PROP_R          unknown             ~2      'default'
          3        ECHO                                                     ~2
   10     4        FETCH_THIS                                       ~3      
          5        FETCH_CLASS                                   0  $4      ~3
          6        FETCH_STATIC_PROP_R          unknown             ~5      'public'
          7        ECHO                                                     ~5
   11     8        FETCH_STATIC_PROP_R          unknown             ~6      'protected'
          9        ECHO                                                     ~6
   12    10        FETCH_STATIC_PROP_R          unknown             ~7      'private'
         11        ECHO                                                     ~7
   13    12      > RETURN                                                   null

End of function test

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.86 ms | 1386 KiB | 13 Q