3v4l.org

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

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Q84O
function name:  __construct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     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
    7     6      > RETURN                                                   null

End of function __construct

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/3Q84O
function name:  __construct
number of ops:  4
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV_INIT                                        !0      null
   13     1        ASSIGN_OBJ                                               'foo'
          2        OP_DATA                                                  !0
   14     3      > RETURN                                                   null

End of function __construct

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.23 ms | 1396 KiB | 19 Q