3v4l.org

run code in 300+ PHP versions simultaneously
<?php gc_enable(); echo memory_get_usage(true)/1024 . "\n"; function callFunc($i = 0) { if ($i < 100000) { gc_collect_cycles(); callFunc(++$i); } } gc_collect_cycles(); callFunc(); gc_collect_cycles(); echo memory_get_usage(true)/1024 . "\n"; callFunc(); gc_collect_cycles(); echo memory_get_usage(true)/1024 . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ppe5R
function name:  (null)
number of ops:  31
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'gc_enable'
          1        DO_ICALL                                                 
    3     2        INIT_FCALL                                               'memory_get_usage'
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $1      
          5        DIV                                              ~2      $1, 1024
          6        CONCAT                                           ~3      ~2, '%0A'
          7        ECHO                                                     ~3
   12     8        INIT_FCALL                                               'gc_collect_cycles'
          9        DO_ICALL                                                 
   14    10        INIT_FCALL                                               'callfunc'
         11        DO_FCALL                                      0          
   15    12        INIT_FCALL                                               'gc_collect_cycles'
         13        DO_ICALL                                                 
   16    14        INIT_FCALL                                               'memory_get_usage'
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $7      
         17        DIV                                              ~8      $7, 1024
         18        CONCAT                                           ~9      ~8, '%0A'
         19        ECHO                                                     ~9
   18    20        INIT_FCALL                                               'callfunc'
         21        DO_FCALL                                      0          
   19    22        INIT_FCALL                                               'gc_collect_cycles'
         23        DO_ICALL                                                 
   20    24        INIT_FCALL                                               'memory_get_usage'
         25        SEND_VAL                                                 <true>
         26        DO_ICALL                                         $12     
         27        DIV                                              ~13     $12, 1024
         28        CONCAT                                           ~14     ~13, '%0A'
         29        ECHO                                                     ~14
         30      > RETURN                                                   1

Function callfunc:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/ppe5R
function name:  callFunc
number of ops:  10
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      0
    6     1        IS_SMALLER                                               !0, 100000
          2      > JMPZ                                                     ~1, ->9
    7     3    >   INIT_FCALL                                               'gc_collect_cycles'
          4        DO_ICALL                                                 
    8     5        INIT_FCALL_BY_NAME                                       'callFunc'
          6        PRE_INC                                          ~3      !0
          7        SEND_VAL_EX                                              ~3
          8        DO_FCALL                                      0          
   10     9    > > RETURN                                                   null

End of function callfunc

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.31 ms | 1007 KiB | 18 Q