3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace test\foo; class Bar { public static function className() { return (new \ReflectionClass(self))->getShortName(); } } echo \test\foo\Bar::className(), PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iMjid
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_STATIC_METHOD_CALL                                  'test%5Cfoo%5CBar', 'className'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
          3        FETCH_CONSTANT                                   ~1      'test%5Cfoo%5CPHP_EOL'
          4        ECHO                                                     ~1
          5      > RETURN                                                   1

Class test\foo\Bar:
Function classname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iMjid
function name:  className
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $0      'ReflectionClass'
          1        FETCH_CONSTANT                                   ~1      'test%5Cfoo%5Cself'
          2        SEND_VAL_EX                                              ~1
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'getShortName'
          5        DO_FCALL                                      0  $3      
          6      > RETURN                                                   $3
    6     7*     > RETURN                                                   null

End of function classname

End of class test\foo\Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.22 ms | 938 KiB | 14 Q