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; } } $usage = 0; $maxima = array(); while (count($maxima) < 5 && $usage < 50000000) { $foo = new Foo(); unset($foo); $last = $usage; $usage = memory_get_usage(); if ($usage < $last) { $maxima[] = $last; } } if (count($maxima)) { printf("Not buggy: Maxima: %s\n", implode('; ', $maxima)); } else { printf("Buggy! Memory never went down."); } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 3
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 32
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
Branch analysis from position: 20
Branch analysis from position: 15
Branch analysis from position: 20
filename:       /in/UZNTc
function name:  (null)
number of ops:  36
compiled vars:  !0 = $usage, !1 = $maxima, !2 = $foo, !3 = $last
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, 0
   18     1        ASSIGN                                                   !1, <array>
   19     2      > JMP                                                      ->15
   20     3    >   NEW                                              $6      'Foo'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $6
   21     6        UNSET_CV                                                 !2
   22     7        ASSIGN                                                   !3, !0
   23     8        INIT_FCALL                                               'memory_get_usage'
          9        DO_ICALL                                         $10     
         10        ASSIGN                                                   !0, $10
   25    11        IS_SMALLER                                               !0, !3
         12      > JMPZ                                                     ~12, ->15
   26    13    >   ASSIGN_DIM                                               !1
         14        OP_DATA                                                  !3
   19    15    >   COUNT                                            ~14     !1
         16        IS_SMALLER                                       ~15     ~14, 5
         17      > JMPZ_EX                                          ~15     ~15, ->20
         18    >   IS_SMALLER                                       ~16     !0, 50000000
         19        BOOL                                             ~15     ~16
         20    > > JMPNZ                                                    ~15, ->3
   30    21    >   COUNT                                            ~17     !1
         22      > JMPZ                                                     ~17, ->32
   31    23    >   INIT_FCALL                                               'printf'
         24        SEND_VAL                                                 'Not+buggy%3A+Maxima%3A+%25s%0A'
         25        INIT_FCALL                                               'implode'
         26        SEND_VAL                                                 '%3B+'
         27        SEND_VAR                                                 !1
         28        DO_ICALL                                         $18     
         29        SEND_VAR                                                 $18
         30        DO_ICALL                                                 
         31      > JMP                                                      ->35
   33    32    >   INIT_FCALL                                               'printf'
         33        SEND_VAL                                                 'Buggy%21+Memory+never+went+down.'
         34        DO_ICALL                                                 
   35    35    > > RETURN                                                   1

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