3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function __construct() { $this->bar = new Bar($this); } } class Bar { function __construct($foo = null) { $this->foo = $foo; } } for($i=0;$i<50000;$i++) { $foo = new Foo(); unset($foo); if($i % 10000 == 0) { 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 = 19, Position 2 = 2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 2
Branch analysis from position: 19
Branch analysis from position: 2
Branch analysis from position: 16
filename:       /in/cZT5S
function name:  (null)
number of ops:  20
compiled vars:  !0 = $i, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, 0
          1      > JMP                                                      ->17
   17     2    >   NEW                                              $3      'Foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
   18     5        UNSET_CV                                                 !1
   19     6        MOD                                              ~6      !0, 10000
          7        IS_EQUAL                                                 ~6, 0
          8      > JMPZ                                                     ~7, ->16
   20     9    >   INIT_FCALL                                               'number_format'
         10        INIT_FCALL                                               'memory_get_usage'
         11        DO_ICALL                                         $8      
         12        SEND_VAR                                                 $8
         13        DO_ICALL                                         $9      
         14        CONCAT                                           ~10     $9, '%0A'
         15        ECHO                                                     ~10
   16    16    >   PRE_INC                                                  !0
         17    >   IS_SMALLER                                               !0, 50000
         18      > JMPNZ                                                    ~12, ->2
   22    19    > > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cZT5S
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

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

End of function __construct

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.36 ms | 945 KiB | 18 Q