3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $bar = 1; public $baz = 2; public $qux = 3; } $a = []; for ($i = 0; $i < 1000; $i++) { $a[] = new Foo(); } var_dump(memory_get_usage()); foreach ($a as $o) { foreach ($o as $p) {} } var_dump(memory_get_usage());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 22
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 20
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
Branch analysis from position: 3
filename:       /in/f8OZj
function name:  (null)
number of ops:  29
compiled vars:  !0 = $a, !1 = $i, !2 = $o, !3 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->8
   11     3    >   NEW                                              $7      'Foo'
          4        DO_FCALL                                      0          
          5        ASSIGN_DIM                                               !0
          6        OP_DATA                                                  $7
   10     7        PRE_INC                                                  !1
          8    >   IS_SMALLER                                               !1, 1000
          9      > JMPNZ                                                    ~10, ->3
   14    10    >   INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'memory_get_usage'
         12        DO_ICALL                                         $11     
         13        SEND_VAR                                                 $11
         14        DO_ICALL                                                 
   16    15      > FE_RESET_R                                       $13     !0, ->22
         16    > > FE_FETCH_R                                               $13, !2, ->22
   17    17    > > FE_RESET_R                                       $14     !2, ->20
         18    > > FE_FETCH_R                                               $14, !3, ->20
         19    > > JMP                                                      ->18
         20    >   FE_FREE                                                  $14
   16    21      > JMP                                                      ->16
         22    >   FE_FREE                                                  $13
   20    23        INIT_FCALL                                               'var_dump'
         24        INIT_FCALL                                               'memory_get_usage'
         25        DO_ICALL                                         $15     
         26        SEND_VAR                                                 $15
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.85 ms | 1396 KiB | 17 Q