3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { function getXName() { return x::getClassName(); } function getXStaticName() { return x::getStaticClassName(); } } class b extends a { } class xabc { public function getClassName() { return get_called_class(); } public static function getStaticClassName() { return get_called_class(); } } $a = new a(); $b = new b(); echo $a->getXStaticName(); // will return "x" echo $b->getXStaticName(); // will return "x" ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5asjA
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $2      'a'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   27     3        NEW                                              $5      'b'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   29     6        INIT_METHOD_CALL                                         !0, 'getXStaticName'
          7        DO_FCALL                                      0  $8      
          8        ECHO                                                     $8
   30     9        INIT_METHOD_CALL                                         !1, 'getXStaticName'
         10        DO_FCALL                                      0  $9      
         11        ECHO                                                     $9
   33    12      > RETURN                                                   1

Class a:
Function getxname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5asjA
function name:  getXName
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_STATIC_METHOD_CALL                                  'x', 'getClassName'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
    6     3*     > RETURN                                                   null

End of function getxname

Function getxstaticname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5asjA
function name:  getXStaticName
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_STATIC_METHOD_CALL                                  'x', 'getStaticClassName'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
    9     3*     > RETURN                                                   null

End of function getxstaticname

End of class a.

Class b:
Function getxname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5asjA
function name:  getXName
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_STATIC_METHOD_CALL                                  'x', 'getClassName'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
    6     3*     > RETURN                                                   null

End of function getxname

Function getxstaticname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5asjA
function name:  getXStaticName
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_STATIC_METHOD_CALL                                  'x', 'getStaticClassName'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
    9     3*     > RETURN                                                   null

End of function getxstaticname

End of class b.

Class xabc:
Function getclassname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5asjA
function name:  getClassName
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   GET_CALLED_CLASS                                 ~0      
          1      > RETURN                                                   ~0
   19     2*     > RETURN                                                   null

End of function getclassname

Function getstaticclassname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5asjA
function name:  getStaticClassName
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   GET_CALLED_CLASS                                 ~0      
          1      > RETURN                                                   ~0
   22     2*     > RETURN                                                   null

End of function getstaticclassname

End of class xabc.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.4 ms | 1390 KiB | 13 Q