3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); trait SomeAbility { public static function theClass(){ return static::class; } } class SomeThing { use SomeAbility; } class SomeOtherThing { use SomeAbility; } var_dump( SomeThing::theClass(), SomeOtherThing::theClass() );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mfKYM
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   DECLARE_CLASS                                            'something'
   14     1        DECLARE_CLASS                                            'someotherthing'
   18     2        INIT_FCALL                                               'var_dump'
   19     3        INIT_STATIC_METHOD_CALL                                  'SomeThing', 'theClass'
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
   20     6        INIT_STATIC_METHOD_CALL                                  'SomeOtherThing', 'theClass'
          7        DO_FCALL                                      0  $1      
          8        SEND_VAR                                                 $1
          9        DO_ICALL                                                 
   21    10      > RETURN                                                   1

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

End of function theclass

End of class SomeAbility.

Class SomeThing: [no user functions]
Class SomeOtherThing: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.96 ms | 1399 KiB | 15 Q