3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { var $foo = 1; } $a = new A; $b = $a; // $a and $b are copies of the same identifier // ($a) = ($b) = <id> $b->foo = 2; echo $a->foo."\n"; $c = new A; $d = &$c; // $c and $d are references // ($c,$d) = <id> $d->foo = 2; echo $c->foo."\n"; $e = new A; function foo($obj) { // ($obj) = ($e) = <id> $obj->foo = 2; } foo($e); echo $e->foo."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q5L61
function name:  (null)
number of ops:  28
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d, !4 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                                              $5      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $5
    7     3        ASSIGN                                                   !1, !0
    9     4        ASSIGN_OBJ                                               !1, 'foo'
          5        OP_DATA                                                  2
   10     6        FETCH_OBJ_R                                      ~10     !0, 'foo'
          7        CONCAT                                           ~11     ~10, '%0A'
          8        ECHO                                                     ~11
   13     9        NEW                                              $12     'A'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $12
   14    12        ASSIGN_REF                                               !3, !2
   17    13        ASSIGN_OBJ                                               !3, 'foo'
         14        OP_DATA                                                  2
   18    15        FETCH_OBJ_R                                      ~17     !2, 'foo'
         16        CONCAT                                           ~18     ~17, '%0A'
         17        ECHO                                                     ~18
   21    18        NEW                                              $19     'A'
         19        DO_FCALL                                      0          
         20        ASSIGN                                                   !4, $19
   28    21        INIT_FCALL                                               'foo'
         22        SEND_VAR                                                 !4
         23        DO_FCALL                                      0          
   29    24        FETCH_OBJ_R                                      ~23     !4, 'foo'
         25        CONCAT                                           ~24     ~23, '%0A'
         26        ECHO                                                     ~24
         27      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q5L61
function name:  foo
number of ops:  4
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   25     1        ASSIGN_OBJ                                               !0, 'foo'
          2        OP_DATA                                                  2
   26     3      > RETURN                                                   null

End of function foo

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.91 ms | 1398 KiB | 14 Q