3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait Tr { public function foo(int $x) {} } class Foo { use Tr; } $f = new Foo();
based on NeSKV
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/X2d9R
function name:  (null)
number of ops:  8
compiled vars:  !0 = $f
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
   8     1        DECLARE_CLASS                                    $2      '%00foo%2Fin%2FX2d9R0x7f68bc95c04e', 'foo'
   9     2        ADD_TRAIT                                                $2, 'Tr'
   8     3        BIND_TRAITS                                              $2
  12     4        NEW                                              $3      :-2
         5        DO_FCALL                                      0          
         6        ASSIGN                                                   !0, $3
         7      > RETURN                                                   1

Class Tr:
Function foo:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/X2d9R
function name:  foo
number of ops:  2
compiled vars:  !0 = $x
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   RECV                                             !0      
         1      > RETURN                                                   null

End of function foo

End of class Tr.

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 7.2.0