3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = 'foo'; var_dump($a = memory_get_usage()); foreach (range(1,100) as $i) { $$i = $foo; } var_dump($b = memory_get_usage()); foreach (range(1,100) as $y) { $$y &= $foo; } var_dump($c = memory_get_usage()); echo "Copy: " . ($b - $a) . "\n"; echo "Ref : " . ($c - $b) . "\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 16
2 jumps found. (Code = 77) Position 1 = 28, Position 2 = 32
Branch analysis from position: 28
2 jumps found. (Code = 78) Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
Branch analysis from position: 16
filename:       /in/NrIdX
function name:  (null)
number of ops:  48
compiled vars:  !0 = $foo, !1 = $a, !2 = $i, !3 = $b, !4 = $y, !5 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'foo'
    3     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'memory_get_usage'
          3        DO_ICALL                                         $7      
          4        ASSIGN                                           ~8      !1, $7
          5        SEND_VAL                                                 ~8
          6        DO_ICALL                                                 
    4     7        INIT_FCALL                                               'range'
          8        SEND_VAL                                                 1
          9        SEND_VAL                                                 100
         10        DO_ICALL                                         $10     
         11      > FE_RESET_R                                       $11     $10, ->16
         12    > > FE_FETCH_R                                               $11, !2, ->16
    5    13    >   FETCH_W                      local               $12     !2
         14        ASSIGN                                                   $12, !0
    4    15      > JMP                                                      ->12
         16    >   FE_FREE                                                  $11
    7    17        INIT_FCALL                                               'var_dump'
         18        INIT_FCALL                                               'memory_get_usage'
         19        DO_ICALL                                         $14     
         20        ASSIGN                                           ~15     !3, $14
         21        SEND_VAL                                                 ~15
         22        DO_ICALL                                                 
    8    23        INIT_FCALL                                               'range'
         24        SEND_VAL                                                 1
         25        SEND_VAL                                                 100
         26        DO_ICALL                                         $17     
         27      > FE_RESET_R                                       $18     $17, ->32
         28    > > FE_FETCH_R                                               $18, !4, ->32
    9    29    >   FETCH_RW                     local               $19     !4
         30        ASSIGN_OP                                    10          $19, !0
    8    31      > JMP                                                      ->28
         32    >   FE_FREE                                                  $18
   11    33        INIT_FCALL                                               'var_dump'
         34        INIT_FCALL                                               'memory_get_usage'
         35        DO_ICALL                                         $21     
         36        ASSIGN                                           ~22     !5, $21
         37        SEND_VAL                                                 ~22
         38        DO_ICALL                                                 
   13    39        SUB                                              ~24     !3, !1
         40        CONCAT                                           ~25     'Copy%3A+', ~24
         41        CONCAT                                           ~26     ~25, '%0A'
         42        ECHO                                                     ~26
   14    43        SUB                                              ~27     !5, !3
         44        CONCAT                                           ~28     'Ref+%3A+', ~27
         45        CONCAT                                           ~29     ~28, '%0A'
         46        ECHO                                                     ~29
         47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.79 ms | 1400 KiB | 19 Q