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' . $a->foo . PHP_EOL; $c = new A; $d = &$c; // $c and $d are references // ($c,$d) = <id> $d->foo = 2; echo '$c->foo' . $c->foo . PHP_EOL; $e = new A; function foo($obj) { // ($obj) = ($e) = <id> $obj->foo = 2; } foo($e); echo '$e->foo' . $e->foo . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K80l5
function name:  (null)
number of ops:  31
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     '%24a-%3Efoo', ~10
          8        CONCAT                                           ~12     ~11, '%0A'
          9        ECHO                                                     ~12
   13    10        NEW                                              $13     'A'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $13
   14    13        ASSIGN_REF                                               !3, !2
   17    14        ASSIGN_OBJ                                               !3, 'foo'
         15        OP_DATA                                                  2
   18    16        FETCH_OBJ_R                                      ~18     !2, 'foo'
         17        CONCAT                                           ~19     '%24c-%3Efoo', ~18
         18        CONCAT                                           ~20     ~19, '%0A'
         19        ECHO                                                     ~20
   21    20        NEW                                              $21     'A'
         21        DO_FCALL                                      0          
         22        ASSIGN                                                   !4, $21
   28    23        INIT_FCALL                                               'foo'
         24        SEND_VAR                                                 !4
         25        DO_FCALL                                      0          
   29    26        FETCH_OBJ_R                                      ~25     !4, 'foo'
         27        CONCAT                                           ~26     '%24e-%3Efoo', ~25
         28        CONCAT                                           ~27     ~26, '%0A'
         29        ECHO                                                     ~27
         30      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K80l5
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:
149.93 ms | 1398 KiB | 14 Q