3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $orig; public function bar() { $this->orig = clone $this; } } $foo = new Foo; for ($i = 0; $i < 20; $i++) { $foo->bar(); echo (memory_get_peak_usage(true) / 1024 / 1024) . "\n"; }
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 = 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/7PRN5
function name:  (null)
number of ops:  18
compiled vars:  !0 = $foo, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   12     3        ASSIGN                                                   !1, 0
          4      > JMP                                                      ->15
   13     5    >   INIT_METHOD_CALL                                         !0, 'bar'
          6        DO_FCALL                                      0          
   14     7        INIT_FCALL                                               'memory_get_peak_usage'
          8        SEND_VAL                                                 <true>
          9        DO_ICALL                                         $7      
         10        DIV                                              ~8      $7, 1024
         11        DIV                                              ~9      ~8, 1024
         12        CONCAT                                           ~10     ~9, '%0A'
         13        ECHO                                                     ~10
   12    14        PRE_INC                                                  !1
         15    >   IS_SMALLER                                               !1, 20
         16      > JMPNZ                                                    ~12, ->5
   15    17    > > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7PRN5
function name:  bar
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_THIS                                       ~1      
          1        CLONE                                            ~2      ~1
          2        ASSIGN_OBJ                                               'orig'
          3        OP_DATA                                                  ~2
    7     4      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.95 ms | 1399 KiB | 16 Q