3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait testTrait { public function testFunc() { return 'I\'m from trait'; } } class testClass { use testTrait; public function testFunc() { return 'I\'m from class'; } } $testClass = new testClass(); echo $testClass->testFunc();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gpudH
function name:  (null)
number of ops:  8
compiled vars:  !0 = $testClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'testclass'
   21     1        NEW                                              $1      'testClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   22     4        INIT_METHOD_CALL                                         !0, 'testFunc'
          5        DO_FCALL                                      0  $4      
          6        ECHO                                                     $4
          7      > RETURN                                                   1

Class testTrait:
Function testfunc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gpudH
function name:  testFunc
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   'I%27m+from+trait'
    8     1*     > RETURN                                                   null

End of function testfunc

End of class testTrait.

Class testClass:
Function testfunc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gpudH
function name:  testFunc
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E > > RETURN                                                   'I%27m+from+class'
   18     1*     > RETURN                                                   null

End of function testfunc

End of class testClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.59 ms | 1394 KiB | 13 Q