3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait ClosureInATrait { public static function getClosureInTrait() { return __CLASS__; } } class ClassConstantTest { use ClosureInATrait; } var_dump(ClassConstantTest::getClosureInClass());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KLg4G
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'classconstanttest'
   15     1        INIT_FCALL                                               'var_dump'
          2        INIT_STATIC_METHOD_CALL                                  'ClassConstantTest', 'getClosureInClass'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Class ClosureInATrait:
Function getclosureintrait:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KLg4G
function name:  getClosureInTrait
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 getclosureintrait

End of class ClosureInATrait.

Class ClassConstantTest: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.72 ms | 1394 KiB | 15 Q