3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait TestTrait { public static function testStaticFunction() { return __CLASS__; } } class Tester { use TestTrait; } $tester = Tester::testStaticFunction();
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/PIR0q
function name:  (null)
number of ops:  8
compiled vars:  !0 = $tester
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  10     1        DECLARE_CLASS                                    $2      '%00tester%2Fin%2FPIR0q0x7f0d03914093', 'tester'
  12     2        ADD_TRAIT                                                $2, 'TestTrait'
  10     3        BIND_TRAITS                                              $2
  14     4        INIT_STATIC_METHOD_CALL                                  'Tester', 'testStaticFunction'
         5        DO_FCALL                                      0  $3      
         6        ASSIGN                                                   !0, $3
         7      > RETURN                                                   1

Class TestTrait:
Function teststaticfunction:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/PIR0q
function name:  testStaticFunction
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 teststaticfunction

End of class TestTrait.

Class Tester: [no user functions]

Generated using Vulcan Logic Dumper, using php 7.2.0