3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A {} function f(A $a): A { $a->v = 12; return $a; } $a = new A(); $a->v = 3; f($a); echo $a->v;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8hQqd
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   11     3        ASSIGN_OBJ                                               !0, 'v'
          4        OP_DATA                                                  3
   12     5        INIT_FCALL                                               'f'
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0          
   14     8        FETCH_OBJ_R                                      ~6      !0, 'v'
          9        ECHO                                                     ~6
         10      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8hQqd
function name:  f
number of ops:  7
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN_OBJ                                               !0, 'v'
          2        OP_DATA                                                  12
    7     3        VERIFY_RETURN_TYPE                                       !0
          4      > RETURN                                                   !0
    8     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function f

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.95 ms | 1397 KiB | 14 Q