3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! function getMemoryUsage() { return round(memory_get_usage() / (1024*1024), 1)." MB"; } function printMemoryUsage() { print("Memory = ".getMemoryUsage()." <br>\n"); } printMemoryUsage(); $end = 1000000; $array = array(); printMemoryUsage(); for($i = 0; $i < $end; $i++) { $array[$i] = 0; } printMemoryUsage(); ?>
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/Soed7
function name:  (null)
number of ops:  16
compiled vars:  !0 = $end, !1 = $array, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'printmemoryusage'
          1        DO_FCALL                                      0          
   15     2        ASSIGN                                                   !0, 1000000
   16     3        ASSIGN                                                   !1, <array>
   17     4        INIT_FCALL                                               'printmemoryusage'
          5        DO_FCALL                                      0          
   18     6        ASSIGN                                                   !2, 0
          7      > JMP                                                      ->11
   20     8    >   ASSIGN_DIM                                               !1, !2
          9        OP_DATA                                                  0
   18    10        PRE_INC                                                  !2
         11    >   IS_SMALLER                                               !2, !0
         12      > JMPNZ                                                    ~10, ->8
   22    13    >   INIT_FCALL                                               'printmemoryusage'
         14        DO_FCALL                                      0          
   23    15      > RETURN                                                   1

Function getmemoryusage:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Soed7
function name:  getMemoryUsage
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'round'
          1        INIT_FCALL                                               'memory_get_usage'
          2        DO_ICALL                                         $0      
          3        DIV                                              ~1      $0, 1048576
          4        SEND_VAL                                                 ~1
          5        SEND_VAL                                                 1
          6        DO_ICALL                                         $2      
          7        CONCAT                                           ~3      $2, '+MB'
          8      > RETURN                                                   ~3
    8     9*     > RETURN                                                   null

End of function getmemoryusage

Function printmemoryusage:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Soed7
function name:  printMemoryUsage
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'getmemoryusage'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      'Memory+%3D+', $0
          3        CONCAT                                           ~2      ~1, '+%3Cbr%3E%0A'
          4        ECHO                                                     ~2
   12     5      > RETURN                                                   null

End of function printmemoryusage

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.45 ms | 1403 KiB | 21 Q