3v4l.org

run code in 300+ PHP versions simultaneously
<?php $memory = memory_get_usage(true); $dates = array(); for ($i = 0; $i < 100; $i++) { $date = new DateTime(); $dates[] = $date->format('Y-m-d H:i:s'); } var_dump(memory_get_usage(true) - $memory); $memory = memory_get_usage(true); $dates = array(); for ($i = 0; $i < 100; $i++) { $dates[] = date('Y-m-d H:i:s', time()); } var_dump(memory_get_usage(true) - $memory);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 7
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 32
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 32
Branch analysis from position: 43
Branch analysis from position: 32
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 7
Branch analysis from position: 18
Branch analysis from position: 7
filename:       /in/kbRhm
function name:  (null)
number of ops:  51
compiled vars:  !0 = $memory, !1 = $dates, !2 = $i, !3 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'memory_get_usage'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    3     4        ASSIGN                                                   !1, <array>
    4     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->16
    5     7    >   NEW                                              $8      'DateTime'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !3, $8
    6    10        INIT_METHOD_CALL                                         !3, 'format'
         11        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         12        DO_FCALL                                      0  $12     
         13        ASSIGN_DIM                                               !1
         14        OP_DATA                                                  $12
    4    15        PRE_INC                                                  !2
         16    >   IS_SMALLER                                               !2, 100
         17      > JMPNZ                                                    ~14, ->7
    9    18    >   INIT_FCALL                                               'var_dump'
         19        INIT_FCALL                                               'memory_get_usage'
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $15     
         22        SUB                                              ~16     $15, !0
         23        SEND_VAL                                                 ~16
         24        DO_ICALL                                                 
   12    25        INIT_FCALL                                               'memory_get_usage'
         26        SEND_VAL                                                 <true>
         27        DO_ICALL                                         $18     
         28        ASSIGN                                                   !0, $18
   13    29        ASSIGN                                                   !1, <array>
   14    30        ASSIGN                                                   !2, 0
         31      > JMP                                                      ->41
   15    32    >   INIT_FCALL                                               'date'
         33        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
         34        INIT_FCALL                                               'time'
         35        DO_ICALL                                         $23     
         36        SEND_VAR                                                 $23
         37        DO_ICALL                                         $24     
         38        ASSIGN_DIM                                               !1
         39        OP_DATA                                                  $24
   14    40        PRE_INC                                                  !2
         41    >   IS_SMALLER                                               !2, 100
         42      > JMPNZ                                                    ~26, ->32
   19    43    >   INIT_FCALL                                               'var_dump'
         44        INIT_FCALL                                               'memory_get_usage'
         45        SEND_VAL                                                 <true>
         46        DO_ICALL                                         $27     
         47        SUB                                              ~28     $27, !0
         48        SEND_VAL                                                 ~28
         49        DO_ICALL                                                 
         50      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.88 ms | 1400 KiB | 21 Q