3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Box { public $value; } $box = new Box(); class Test { public function __construct() { global $box; var_dump($box->value = $this); } function __destruct() { global $box; unset($box->value); } } new Test(); new Test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9l3PK
function name:  (null)
number of ops:  10
compiled vars:  !0 = $box
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   NEW                                                  $1      'Box'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   22     3        NEW                                                  $4      'Test'
          4        DO_FCALL                                          0          
          5        FREE                                                         $4
   23     6        NEW                                                  $6      'Test'
          7        DO_FCALL                                          0          
          8        FREE                                                         $6
          9      > RETURN                                                       1

Class Box: [no user functions]
Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9l3PK
function name:  __construct
number of ops:  8
compiled vars:  !0 = $box
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   BIND_GLOBAL                                                  !0, 'box'
   13     1        INIT_FCALL                                                   'var_dump'
          2        FETCH_THIS                                           ~2      
          3        ASSIGN_OBJ                                           ~1      !0, 'value'
          4        OP_DATA                                                      ~2
          5        SEND_VAL                                                     ~1
          6        DO_ICALL                                                     
   14     7      > RETURN                                                       null

End of function __construct

Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9l3PK
function name:  __destruct
number of ops:  3
compiled vars:  !0 = $box
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   BIND_GLOBAL                                                  !0, 'box'
   18     1        UNSET_OBJ                                                    !0, 'value'
   19     2      > RETURN                                                       null

End of function __destruct

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
128.63 ms | 490 KiB | 10 Q