3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo; use Foo\Bar as Baz; class Bar { public static function getClass() { return __CLASS__; } public static function getCalledClass() { return get_called_class(); } } class Biz extends Bar {} var_dump(Baz::CLASS, Baz::getClass(), Giz::CLASS, Biz::getClass(), Biz::getCalledClass(), Biz::CLASS);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M1QHp
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_NS_FCALL_BY_NAME                                    'Foo%5Cvar_dump'
          1        SEND_VAL_EX                                              'Foo%5CBar'
          2        INIT_STATIC_METHOD_CALL                                  'Foo%5CBar', 'getClass'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR_NO_REF_EX                                       $0
          5        SEND_VAL_EX                                              'Foo%5CGiz'
          6        INIT_STATIC_METHOD_CALL                                  'Foo%5CBiz', 'getClass'
          7        DO_FCALL                                      0  $1      
          8        SEND_VAR_NO_REF_EX                                       $1
          9        INIT_STATIC_METHOD_CALL                                  'Foo%5CBiz', 'getCalledClass'
         10        DO_FCALL                                      0  $2      
         11        SEND_VAR_NO_REF_EX                                       $2
         12        SEND_VAL_EX                                              'Foo%5CBiz'
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

Class Foo\Bar:
Function getclass:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M1QHp
function name:  getClass
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   'Foo%5CBar'
   10     1*     > RETURN                                                   null

End of function getclass

Function getcalledclass:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M1QHp
function name:  getCalledClass
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_NS_FCALL_BY_NAME                                    'Foo%5Cget_called_class'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   13     3*     > RETURN                                                   null

End of function getcalledclass

End of class Foo\Bar.

Class Foo\Biz:
Function getclass:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M1QHp
function name:  getClass
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   'Foo%5CBar'
   10     1*     > RETURN                                                   null

End of function getclass

Function getcalledclass:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M1QHp
function name:  getCalledClass
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_NS_FCALL_BY_NAME                                    'Foo%5Cget_called_class'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   13     3*     > RETURN                                                   null

End of function getcalledclass

End of class Foo\Biz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.47 ms | 1400 KiB | 17 Q