3v4l.org

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

Function usage:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/01qOs
function name:  usage
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'function_exists'
          1        SEND_VAL                                                 'memory_get_usage'
          2        DO_ICALL                                         $0      
          3      > JMPZ                                                     $0, ->9
    5     4    >   INIT_FCALL                                               'memory_get_usage'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $1      
          7      > RETURN                                                   $1
          8*       JMP                                                      ->10
    7     9    > > RETURN                                                   '%3F'
    9    10*     > RETURN                                                   null

End of function usage

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.34 ms | 1394 KiB | 20 Q