3v4l.org

run code in 300+ PHP versions simultaneously
<?php defined('PHP_EOL') or define('PHP_EOL', "\n"); class A { public static function test(){ echo '__CLASS__ = ' . __CLASS__ . PHP_EOL; echo 'get_class = ' . get_class() . PHP_EOL; echo 'GetClass = ' . static::GetClass() . PHP_EOL; echo 'CalledCls = ' . get_called_class() . PHP_EOL; } public static function GetClass(){ return __CLASS__; } } class B extends A { public static function GetClass(){ return __CLASS__; } } echo 'A' . PHP_EOL; A::test(); echo 'B' . PHP_EOL; B::test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aKohJ
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   ECHO                                                     'A%0A'
   23     1        INIT_STATIC_METHOD_CALL                                  'A', 'test'
          2        DO_FCALL                                      0          
   24     3        ECHO                                                     'B%0A'
   25     4        INIT_STATIC_METHOD_CALL                                  'B', 'test'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class A:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aKohJ
function name:  test
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                     '__CLASS__+%3D+A%0A'
    7     1        GET_CLASS                                        ~0      
          2        CONCAT                                           ~1      'get_class+%3D+', ~0
          3        CONCAT                                           ~2      ~1, '%0A'
          4        ECHO                                                     ~2
    8     5        INIT_STATIC_METHOD_CALL                                  'GetClass'
          6        DO_FCALL                                      0  $3      
          7        CONCAT                                           ~4      'GetClass++%3D+', $3
          8        CONCAT                                           ~5      ~4, '%0A'
          9        ECHO                                                     ~5
    9    10        GET_CALLED_CLASS                                 ~6      
         11        CONCAT                                           ~7      'CalledCls+%3D+', ~6
         12        CONCAT                                           ~8      ~7, '%0A'
         13        ECHO                                                     ~8
   10    14      > RETURN                                                   null

End of function test

Function getclass:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aKohJ
function name:  GetClass
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E > > RETURN                                                   'A'
   13     1*     > RETURN                                                   null

End of function getclass

End of class A.

Class B:
Function getclass:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aKohJ
function name:  GetClass
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E > > RETURN                                                   'B'
   19     1*     > RETURN                                                   null

End of function getclass

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aKohJ
function name:  test
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                     '__CLASS__+%3D+A%0A'
    7     1        GET_CLASS                                        ~0      
          2        CONCAT                                           ~1      'get_class+%3D+', ~0
          3        CONCAT                                           ~2      ~1, '%0A'
          4        ECHO                                                     ~2
    8     5        INIT_STATIC_METHOD_CALL                                  'GetClass'
          6        DO_FCALL                                      0  $3      
          7        CONCAT                                           ~4      'GetClass++%3D+', $3
          8        CONCAT                                           ~5      ~4, '%0A'
          9        ECHO                                                     ~5
    9    10        GET_CALLED_CLASS                                 ~6      
         11        CONCAT                                           ~7      'CalledCls+%3D+', ~6
         12        CONCAT                                           ~8      ~7, '%0A'
         13        ECHO                                                     ~8
   10    14      > RETURN                                                   null

End of function test

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.3 ms | 1399 KiB | 13 Q