3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Foo { public function hello(): string { return "Hello from Foo!"; } } class Bar { use Foo { hello as private somethingElse; } } $bar = new Bar(); var_dump($bar->hello()); // Throws var_dump($bar->somethingElse());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uAjcv
function name:  (null)
number of ops:  15
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   DECLARE_CLASS                                            'bar'
   16     1        NEW                                              $1      'Bar'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   17     4        INIT_FCALL                                               'var_dump'
          5        INIT_METHOD_CALL                                         !0, 'hello'
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
   19     9        INIT_FCALL                                               'var_dump'
         10        INIT_METHOD_CALL                                         !0, 'somethingElse'
         11        DO_FCALL                                      0  $6      
         12        SEND_VAR                                                 $6
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class Foo:
Function hello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uAjcv
function name:  hello
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   'Hello+from+Foo%21'
    7     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function hello

End of class Foo.

Class Bar: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.46 ms | 1001 KiB | 14 Q