3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface fooAPI{ public function doFoo(); } trait fooable{ protected $foo; public function __construct( $foo ){ $this->_foo = $foo; } public function doFoo(){ return $this->_foo; } } class Foo{ use fooable{ fooable::__construct as _fooable__construct; _fooable__construct as protected; } public function __construct(){ $this->_fooable__construct( "foo" ); } } echo (new Foo)->doFoo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YllN2
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_CLASS                                            'foo'
   23     1        NEW                                              $0      'Foo'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'doFoo'
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
          6      > RETURN                                                   1

Class fooAPI:
Function dofoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YllN2
function name:  doFoo
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   null

End of function dofoo

End of class fooAPI.

Class fooable:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YllN2
function name:  __construct
number of ops:  4
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        ASSIGN_OBJ                                               '_foo'
          2        OP_DATA                                                  !0
          3      > RETURN                                                   null

End of function __construct

Function dofoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YllN2
function name:  doFoo
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_OBJ_R                                      ~0      '_foo'
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function dofoo

End of class fooable.

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YllN2
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_METHOD_CALL                                         '_fooable__construct'
          1        SEND_VAL_EX                                              'foo'
          2        DO_FCALL                                      0          
   20     3      > RETURN                                                   null

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.32 ms | 1399 KiB | 13 Q