3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public function __construct($x, $y) { $this->x = $x; $this->y = $y; } } $one = new Foo("foo", $a = [&$b]); $two = new Foo("foo", $b = [&$a]); var_dump($one == $two);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MZm12
function name:  (null)
number of ops:  19
compiled vars:  !0 = $one, !1 = $a, !2 = $b, !3 = $two
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   NEW                                                  $4      'Foo'
          1        SEND_VAL_EX                                                  'foo'
          2        INIT_ARRAY                                           ~5      !2
          3        ASSIGN                                               ~6      !1, ~5
          4        SEND_VAL_EX                                                  ~6
          5        DO_FCALL                                          0          
          6        ASSIGN                                                       !0, $4
   13     7        NEW                                                  $9      'Foo'
          8        SEND_VAL_EX                                                  'foo'
          9        INIT_ARRAY                                           ~10     !1
         10        ASSIGN                                               ~11     !2, ~10
         11        SEND_VAL_EX                                                  ~11
         12        DO_FCALL                                          0          
         13        ASSIGN                                                       !3, $9
   15    14        INIT_FCALL                                                   'var_dump'
         15        IS_EQUAL                                             ~14     !0, !3
         16        SEND_VAL                                                     ~14
         17        DO_ICALL                                                     
         18      > RETURN                                                       1

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

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.94 ms | 2156 KiB | 14 Q