3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class A{ protected $foo = 'I m foo'; } class B extends A{ static function sayFoo(){ $bar = new self(); echo $bar->foo; } } B::sayFoo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S9IXt
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_STATIC_METHOD_CALL                                  'B', 'sayFoo'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Class A: [no user functions]
Class B:
Function sayfoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S9IXt
function name:  sayFoo
number of ops:  6
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                          self                $1      
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   10     3        FETCH_OBJ_R                                      ~4      !0, 'foo'
          4        ECHO                                                     ~4
   11     5      > RETURN                                                   null

End of function sayfoo

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.83 ms | 1384 KiB | 13 Q