3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { function foo() { print __CLASS__ . "\n"; print get_class() . "\n"; print static::class . "\n"; } } class B extends A { } $b = new B(); $a = new A(); $a->foo(); $b->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/le0Di
function name:  (null)
number of ops:  11
compiled vars:  !0 = $b, !1 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   NEW                                                  $2      'B'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   16     3        NEW                                                  $5      'A'
          4        DO_FCALL                                          0          
          5        ASSIGN                                                       !1, $5
   18     6        INIT_METHOD_CALL                                             !1, 'foo'
          7        DO_FCALL                                          0          
   19     8        INIT_METHOD_CALL                                             !0, 'foo'
          9        DO_FCALL                                          0          
         10      > RETURN                                                       1

Class A:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/le0Di
function name:  foo
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                         'A%0A'
    6     1        GET_CLASS                                            ~0      
          2        CONCAT                                               ~1      ~0, '%0A'
          3        ECHO                                                         ~1
    7     4        FETCH_CLASS_NAME                                     ~2      
          5        CONCAT                                               ~3      ~2, '%0A'
          6        ECHO                                                         ~3
    8     7      > RETURN                                                       null

End of function foo

End of class A.

Class B:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/le0Di
function name:  foo
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                         'A%0A'
    6     1        GET_CLASS                                            ~0      
          2        CONCAT                                               ~1      ~0, '%0A'
          3        ECHO                                                         ~1
    7     4        FETCH_CLASS_NAME                                     ~2      
          5        CONCAT                                               ~3      ~2, '%0A'
          6        ECHO                                                         ~3
    8     7      > RETURN                                                       null

End of function foo

End of class B.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
124.94 ms | 476 KiB | 7 Q