3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A extends \stdClass { public int $i = 42; } $holder = []; for ($i = 0; $i < 10000; $i++) { $holder[] = new A; } var_dump(memory_get_usage()); foreach ($holder as $obj) { } var_dump(memory_get_usage()); $unserialized_holder = []; foreach ($holder as $obj) { $unserialized_holder[] = \unserialize(\serialize($obj)); } unset($holder); 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 = 18
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 36
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 36
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
Branch analysis from position: 18
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/nRUnW
function name:  (null)
number of ops:  44
compiled vars:  !0 = $holder, !1 = $i, !2 = $obj, !3 = $unserialized_holder
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
    6     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->8
    7     3    >   NEW                                              $7      'A'
          4        DO_FCALL                                      0          
          5        ASSIGN_DIM                                               !0
          6        OP_DATA                                                  $7
    6     7        PRE_INC                                                  !1
          8    >   IS_SMALLER                                               !1, 10000
          9      > JMPNZ                                                    ~10, ->3
   10    10    >   INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'memory_get_usage'
         12        DO_ICALL                                         $11     
         13        SEND_VAR                                                 $11
         14        DO_ICALL                                                 
   12    15      > FE_RESET_R                                       $13     !0, ->18
         16    > > FE_FETCH_R                                               $13, !2, ->18
         17    > > JMP                                                      ->16
         18    >   FE_FREE                                                  $13
   15    19        INIT_FCALL                                               'var_dump'
         20        INIT_FCALL                                               'memory_get_usage'
         21        DO_ICALL                                         $14     
         22        SEND_VAR                                                 $14
         23        DO_ICALL                                                 
   17    24        ASSIGN                                                   !3, <array>
   18    25      > FE_RESET_R                                       $17     !0, ->36
         26    > > FE_FETCH_R                                               $17, !2, ->36
   19    27    >   INIT_FCALL                                               'unserialize'
         28        INIT_FCALL                                               'serialize'
         29        SEND_VAR                                                 !2
         30        DO_ICALL                                         $19     
         31        SEND_VAR                                                 $19
         32        DO_ICALL                                         $20     
         33        ASSIGN_DIM                                               !3
         34        OP_DATA                                                  $20
   18    35      > JMP                                                      ->26
         36    >   FE_FREE                                                  $17
   21    37        UNSET_CV                                                 !0
   23    38        INIT_FCALL                                               'var_dump'
         39        INIT_FCALL                                               'memory_get_usage'
         40        DO_ICALL                                         $21     
         41        SEND_VAR                                                 $21
         42        DO_ICALL                                                 
         43      > RETURN                                                   1

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.74 ms | 1461 KiB | 17 Q