3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(array $a) { echo memory_get_usage(), PHP_EOL; echo count($a), PHP_EOL; echo memory_get_usage(), PHP_EOL; } $array = range(1, 100000); echo memory_get_usage(), PHP_EOL; foo($array); echo memory_get_usage(), PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kSWZJ
function name:  (null)
number of ops:  17
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 100000
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
   10     5        INIT_FCALL                                               'memory_get_usage'
          6        DO_ICALL                                         $3      
          7        ECHO                                                     $3
          8        ECHO                                                     '%0A'
   11     9        INIT_FCALL                                               'foo'
         10        SEND_VAR                                                 !0
         11        DO_FCALL                                      0          
   12    12        INIT_FCALL                                               'memory_get_usage'
         13        DO_ICALL                                         $5      
         14        ECHO                                                     $5
         15        ECHO                                                     '%0A'
         16      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kSWZJ
function name:  foo
number of ops:  13
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'memory_get_usage'
          2        DO_ICALL                                         $1      
          3        ECHO                                                     $1
          4        ECHO                                                     '%0A'
    5     5        COUNT                                            ~2      !0
          6        ECHO                                                     ~2
          7        ECHO                                                     '%0A'
    6     8        INIT_FCALL                                               'memory_get_usage'
          9        DO_ICALL                                         $3      
         10        ECHO                                                     $3
         11        ECHO                                                     '%0A'
    7    12      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.98 ms | 1399 KiB | 18 Q