3v4l.org

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

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

End of function doit

End of class a.

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

End of function doit

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
122.41 ms | 1399 KiB | 13 Q