3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Example; class Base { static function whoAmI() { return static::class; } } class Example extends Base {} $what = 'Example'; var_dump($what::whoAmI());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DWlqY
function name:  (null)
number of ops:  8
compiled vars:  !0 = $what
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, 'Example'
   14     1        INIT_NS_FCALL_BY_NAME                                    'Example%5Cvar_dump'
          2        FETCH_CLASS                                   0  $2      !0
          3        INIT_STATIC_METHOD_CALL                                  $2, 'whoAmI'
          4        DO_FCALL                                      0  $3      
          5        SEND_VAR_NO_REF_EX                                       $3
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Class Example\Base:
Function whoami:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DWlqY
function name:  whoAmI
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_CLASS_NAME                                 ~0      
          1      > RETURN                                                   ~0
    8     2*     > RETURN                                                   null

End of function whoami

End of class Example\Base.

Class Example\Example:
Function whoami:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DWlqY
function name:  whoAmI
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_CLASS_NAME                                 ~0      
          1      > RETURN                                                   ~0
    8     2*     > RETURN                                                   null

End of function whoami

End of class Example\Example.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.56 ms | 1386 KiB | 15 Q