3v4l.org

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

Class A:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fudKa
function name:  test
number of ops:  5
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                          static              $1      
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    7     3        ECHO                                                     'A'
    8     4      > RETURN                                                   null

End of function test

End of class A.

Class B:
Function test2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fudKa
function name:  test2
number of ops:  5
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                          static              $1      
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        ECHO                                                     'B'
   16     4      > RETURN                                                   null

End of function test2

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fudKa
function name:  test
number of ops:  5
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                          static              $1      
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    7     3        ECHO                                                     'A'
    8     4      > RETURN                                                   null

End of function test

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.35 ms | 1395 KiB | 13 Q