3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X { public $mark; } $a = new X(); $a->mark = "instance1"; # in background there is a new X instance now $b = new X(); $b->mark = "instance2"; # and another $c = $a; $b = $a; echo $a->mark . "\n"; echo $b->mark . "\n"; echo $c->mark . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0MWfh
function name:  (null)
number of ops:  22
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $3      'X'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
          3        ASSIGN_OBJ                                               !0, 'mark'
          4        OP_DATA                                                  'instance1'
    6     5        NEW                                              $7      'X'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
          8        ASSIGN_OBJ                                               !1, 'mark'
          9        OP_DATA                                                  'instance2'
    7    10        ASSIGN                                                   !2, !0
    9    11        ASSIGN                                                   !1, !0
   11    12        FETCH_OBJ_R                                      ~13     !0, 'mark'
         13        CONCAT                                           ~14     ~13, '%0A'
         14        ECHO                                                     ~14
   12    15        FETCH_OBJ_R                                      ~15     !1, 'mark'
         16        CONCAT                                           ~16     ~15, '%0A'
         17        ECHO                                                     ~16
   13    18        FETCH_OBJ_R                                      ~17     !2, 'mark'
         19        CONCAT                                           ~18     ~17, '%0A'
         20        ECHO                                                     ~18
         21      > RETURN                                                   1

Class X: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.38 ms | 1393 KiB | 13 Q