3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime('2018-12-31 00:00:00'); $end = new DateTime('2021-12-31 00:00:00'); $interval = new DateInterval('P1M'); $recurrences = 5; $elements = []; for ($i = 0; $i < 25000; $i++) { $elements[] = new DatePeriod($start, $interval, $recurrences, DatePeriod::EXCLUDE_START_DATE); } echo "Memory usage: " . memory_get_usage(true) / (1024 * 1024) . " MB\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 16
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 16
Branch analysis from position: 27
Branch analysis from position: 16
filename:       /in/QW9Tm
function name:  (null)
number of ops:  35
compiled vars:  !0 = $start, !1 = $end, !2 = $interval, !3 = $recurrences, !4 = $elements, !5 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $6      'DateTime'
          1        SEND_VAL_EX                                              '2018-12-31+00%3A00%3A00'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $6
    4     4        NEW                                              $9      'DateTime'
          5        SEND_VAL_EX                                              '2021-12-31+00%3A00%3A00'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $9
    5     8        NEW                                              $12     'DateInterval'
          9        SEND_VAL_EX                                              'P1M'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $12
    6    12        ASSIGN                                                   !3, 5
    8    13        ASSIGN                                                   !4, <array>
    9    14        ASSIGN                                                   !5, 0
         15      > JMP                                                      ->25
   10    16    >   NEW                                              $19     'DatePeriod'
         17        SEND_VAR_EX                                              !0
         18        SEND_VAR_EX                                              !2
         19        SEND_VAR_EX                                              !3
         20        SEND_VAL_EX                                              1
         21        DO_FCALL                                      0          
         22        ASSIGN_DIM                                               !4
         23        OP_DATA                                                  $19
    9    24        PRE_INC                                                  !5
         25    >   IS_SMALLER                                               !5, 25000
         26      > JMPNZ                                                    ~22, ->16
   13    27    >   INIT_FCALL                                               'memory_get_usage'
         28        SEND_VAL                                                 <true>
         29        DO_ICALL                                         $23     
         30        DIV                                              ~24     $23, 1048576
         31        CONCAT                                           ~25     'Memory+usage%3A+', ~24
         32        CONCAT                                           ~26     ~25, '+MB%0A'
         33        ECHO                                                     ~26
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.22 ms | 998 KiB | 14 Q