3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { public static function foo() { print static::class . "\n"; print get_called_class() . "\n\n"; } } class B extends A { } B::foo(); A::foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vlA9g
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   INIT_STATIC_METHOD_CALL                                      'B', 'foo'
          1        DO_FCALL                                          0          
   14     2        INIT_STATIC_METHOD_CALL                                      'A', 'foo'
          3        DO_FCALL                                          0          
          4      > RETURN                                                       1

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

End of function foo

End of class B.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
125.36 ms | 475 KiB | 7 Q