3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait T { protected int $x; } class A { use T; } class B { use T; public function writeToA(A $a): void { $a->x = 1; } } (new B)->writeToA(new A);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hM5TM
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_CLASS                                            'a'
   10     1        DECLARE_CLASS                                            'b'
   20     2        NEW                                              $0      'B'
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'writeToA'
          5        NEW                                              $2      'A'
          6        DO_FCALL                                      0          
          7        SEND_VAR_NO_REF_EX                                       $2
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class T: [no user functions]
Class A: [no user functions]
Class B:
Function writetoa:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hM5TM
function name:  writeToA
number of ops:  4
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   16     1        ASSIGN_OBJ                                               !0, 'x'
          2        OP_DATA                                                  1
   17     3      > RETURN                                                   null

End of function writetoa

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
134.41 ms | 994 KiB | 13 Q