3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $id; public function __construct() { $id = $used++; } public function getId() { return $id; } } $a = new Foo; // $a is a pointer pointing to Foo object 0 $b = $a; // $b is a pointer pointing to Foo object 0, however, $b is a copy of $a unlink($a); var_dump($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ItKhC
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   14     3        ASSIGN                                                   !1, !0
   15     4        INIT_FCALL                                               'unlink'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
   16     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ItKhC
function name:  __construct
number of ops:  3
compiled vars:  !0 = $id, !1 = $used
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   POST_INC                                         ~2      !1
          1        ASSIGN                                                   !0, ~2
    7     2      > RETURN                                                   null

End of function __construct

Function getid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ItKhC
function name:  getId
number of ops:  2
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   !0
   10     1*     > RETURN                                                   null

End of function getid

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.49 ms | 1395 KiB | 17 Q