3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait AutowireTrait { final public function autowire(bool $autowired = true): self { return $this; } } class A { public function autowire($autowired = true) { return $this; } } class B extends A { use AutowireTrait; } var_dump((new B)->autowire());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EAsk8
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   DECLARE_CLASS                                            'b', 'a'
   24     1        INIT_FCALL                                               'var_dump'
          2        NEW                                              $0      'B'
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'autowire'
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class AutowireTrait:
Function autowire:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EAsk8
function name:  autowire
number of ops:  6
compiled vars:  !0 = $autowired
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      <true>
    7     1        FETCH_THIS                                       ~1      
          2        VERIFY_RETURN_TYPE                                       ~1
          3      > RETURN                                                   ~1
    8     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function autowire

End of class AutowireTrait.

Class A:
Function autowire:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EAsk8
function name:  autowire
number of ops:  4
compiled vars:  !0 = $autowired
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV_INIT                                        !0      <true>
   15     1        FETCH_THIS                                       ~1      
          2      > RETURN                                                   ~1
   16     3*     > RETURN                                                   null

End of function autowire

End of class A.

Class B: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.32 ms | 1426 KiB | 14 Q