3v4l.org

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

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

End of function magic

Class Number: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.9 ms | 1397 KiB | 14 Q