3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function __construct() { $this->bar = new Bar($this); } function __destruct() { unset($this->bar); } } class Bar { function __construct($foo = null) { $this->foo = $foo; } } $i = 1; while ($i++ < 1000) { $foo = new Foo(); $foo->__destruct(); unset($foo); if ($i > 990) { echo number_format(memory_get_usage()) . "\n"; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 2
Branch analysis from position: 20
Branch analysis from position: 2
Branch analysis from position: 17
filename:       /in/MGMjN
function name:  (null)
number of ops:  21
compiled vars:  !0 = $i, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ASSIGN                                                   !0, 1
   20     1      > JMP                                                      ->17
   21     2    >   NEW                                              $3      'Foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
   22     5        INIT_METHOD_CALL                                         !1, '__destruct'
          6        DO_FCALL                                      0          
   23     7        UNSET_CV                                                 !1
   24     8        IS_SMALLER                                               990, !0
          9      > JMPZ                                                     ~7, ->17
   25    10    >   INIT_FCALL                                               'number_format'
         11        INIT_FCALL                                               'memory_get_usage'
         12        DO_ICALL                                         $8      
         13        SEND_VAR                                                 $8
         14        DO_ICALL                                         $9      
         15        CONCAT                                           ~10     $9, '%0A'
         16        ECHO                                                     ~10
   20    17    >   POST_INC                                         ~11     !0
         18        IS_SMALLER                                               ~11, 1000
         19      > JMPNZ                                                    ~12, ->2
   27    20    > > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MGMjN
function name:  __construct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $1      'Bar'
          1        FETCH_THIS                                       $2      
          2        SEND_VAR_EX                                              $2
          3        DO_FCALL                                      0          
          4        ASSIGN_OBJ                                               'bar'
          5        OP_DATA                                                  $1
    6     6      > 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/MGMjN
function name:  __destruct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   UNSET_OBJ                                                'bar'
    9     1      > RETURN                                                   null

End of function __destruct

End of class Foo.

Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MGMjN
function name:  __construct
number of ops:  4
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV_INIT                                        !0      null
   15     1        ASSIGN_OBJ                                               'foo'
          2        OP_DATA                                                  !0
   16     3      > RETURN                                                   null

End of function __construct

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.24 ms | 1400 KiB | 17 Q