3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(){ $ret = []; for($i=0;$i<100000;$i++){ $ret[]= new stdClass(); } return $ret; } $i=0; echo memory_get_usage()."\n"; while($i++<10){ if($i==1){ $a=test(); echo memory_get_usage()."\n"; unset($a); } echo memory_get_usage()."\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 6
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 6
Branch analysis from position: 23
Branch analysis from position: 6
Branch analysis from position: 16
filename:       /in/89tgL
function name:  (null)
number of ops:  24
compiled vars:  !0 = $i, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, 0
   12     1        INIT_FCALL                                               'memory_get_usage'
          2        DO_ICALL                                         $3      
          3        CONCAT                                           ~4      $3, '%0A'
          4        ECHO                                                     ~4
   13     5      > JMP                                                      ->20
   14     6    >   IS_EQUAL                                                 !0, 1
          7      > JMPZ                                                     ~5, ->16
   15     8    >   INIT_FCALL                                               'test'
          9        DO_FCALL                                      0  $6      
         10        ASSIGN                                                   !1, $6
   16    11        INIT_FCALL                                               'memory_get_usage'
         12        DO_ICALL                                         $8      
         13        CONCAT                                           ~9      $8, '%0A'
         14        ECHO                                                     ~9
   17    15        UNSET_CV                                                 !1
   19    16    >   INIT_FCALL                                               'memory_get_usage'
         17        DO_ICALL                                         $10     
         18        CONCAT                                           ~11     $10, '%0A'
         19        ECHO                                                     ~11
   13    20    >   POST_INC                                         ~12     !0
         21        IS_SMALLER                                               ~12, 10
         22      > JMPNZ                                                    ~13, ->6
   20    23    > > RETURN                                                   1

Function test:
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
1 jumps found. (Code = 62) Position 1 = -2
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/89tgL
function name:  test
number of ops:  12
compiled vars:  !0 = $ret, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->8
    6     3    >   NEW                                              $5      'stdClass'
          4        DO_FCALL                                      0          
          5        ASSIGN_DIM                                               !0
          6        OP_DATA                                                  $5
    5     7        PRE_INC                                                  !1
          8    >   IS_SMALLER                                               !1, 100000
          9      > JMPNZ                                                    ~8, ->3
    8    10    > > RETURN                                                   !0
   10    11*     > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.24 ms | 1403 KiB | 16 Q