3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getusageempty() { $start = memory_get_usage(); return memory_get_usage() - $start; } function getusage() { $start = memory_get_usage(); $a = 256; return memory_get_usage() - $start - getusageempty(); } echo getusage();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HnXNv
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'getusage'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
          3      > RETURN                                                   1

Function getusageempty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HnXNv
function name:  getusageempty
number of ops:  8
compiled vars:  !0 = $start
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'memory_get_usage'
          1        DO_ICALL                                         $1      
          2        ASSIGN                                                   !0, $1
    5     3        INIT_FCALL                                               'memory_get_usage'
          4        DO_ICALL                                         $3      
          5        SUB                                              ~4      $3, !0
          6      > RETURN                                                   ~4
    6     7*     > RETURN                                                   null

End of function getusageempty

Function getusage:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HnXNv
function name:  getusage
number of ops:  12
compiled vars:  !0 = $start, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'memory_get_usage'
          1        DO_ICALL                                         $2      
          2        ASSIGN                                                   !0, $2
    9     3        ASSIGN                                                   !1, 256
   10     4        INIT_FCALL                                               'memory_get_usage'
          5        DO_ICALL                                         $5      
          6        SUB                                              ~6      $5, !0
          7        INIT_FCALL                                               'getusageempty'
          8        DO_FCALL                                      0  $7      
          9        SUB                                              ~8      ~6, $7
         10      > RETURN                                                   ~8
   11    11*     > RETURN                                                   null

End of function getusage

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.45 ms | 1399 KiB | 17 Q