3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(); for ($i = 0; $i < 100000; $i++) { $arr[] = array("foo" => $i, "bar" => $i); } print(memory_get_peak_usage() . "\r\n"); $arr_chunked = array_chunk($arr, 100); print(memory_get_peak_usage() . "\r\n");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 3
Branch analysis from position: 10
Branch analysis from position: 3
filename:       /in/XWX9R
function name:  (null)
number of ops:  24
compiled vars:  !0 = $arr, !1 = $i, !2 = $arr_chunked
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->8
    4     3    >   INIT_ARRAY                                       ~6      !1, 'foo'
          4        ADD_ARRAY_ELEMENT                                ~6      !1, 'bar'
          5        ASSIGN_DIM                                               !0
          6        OP_DATA                                                  ~6
    3     7        PRE_INC                                                  !1
          8    >   IS_SMALLER                                               !1, 100000
          9      > JMPNZ                                                    ~8, ->3
    7    10    >   INIT_FCALL                                               'memory_get_peak_usage'
         11        DO_ICALL                                         $9      
         12        CONCAT                                           ~10     $9, '%0D%0A'
         13        ECHO                                                     ~10
    9    14        INIT_FCALL                                               'array_chunk'
         15        SEND_VAR                                                 !0
         16        SEND_VAL                                                 100
         17        DO_ICALL                                         $11     
         18        ASSIGN                                                   !2, $11
   11    19        INIT_FCALL                                               'memory_get_peak_usage'
         20        DO_ICALL                                         $13     
         21        CONCAT                                           ~14     $13, '%0D%0A'
         22        ECHO                                                     ~14
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.97 ms | 1395 KiB | 17 Q