3v4l.org

run code in 300+ PHP versions simultaneously
<?php $days = []; $searchData = ['dat' => '2015-11-10']; $offset = 3; $now = date_create(); $offsetStart = -1 * $offset; if (date_create($searchData['dat'])->modify($offset .' days') < $now) { $offsetStart = -1 * date_create($searchData['dat'])->diff($now)->format('%a'); } $offsetEnd = 2 * $offset + $offsetStart; for ($i = $offsetStart; $i <= $offsetEnd; $i++) { $days[] = $i; } print_r($days);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 30
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 35
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 35
Branch analysis from position: 40
Branch analysis from position: 35
Branch analysis from position: 30
filename:       /in/bnPDq
function name:  (null)
number of ops:  44
compiled vars:  !0 = $days, !1 = $searchData, !2 = $offset, !3 = $now, !4 = $offsetStart, !5 = $offsetEnd, !6 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, 3
    6     3        INIT_FCALL                                               'date_create'
          4        DO_ICALL                                         $10     
          5        ASSIGN                                                   !3, $10
    8     6        MUL                                              ~12     !2, -1
          7        ASSIGN                                                   !4, ~12
    9     8        INIT_FCALL                                               'date_create'
          9        FETCH_DIM_R                                      ~14     !1, 'dat'
         10        SEND_VAL                                                 ~14
         11        DO_ICALL                                         $15     
         12        INIT_METHOD_CALL                                         $15, 'modify'
         13        CONCAT                                           ~16     !2, '+days'
         14        SEND_VAL_EX                                              ~16
         15        DO_FCALL                                      0  $17     
         16        IS_SMALLER                                               $17, !3
         17      > JMPZ                                                     ~18, ->30
   10    18    >   INIT_FCALL                                               'date_create'
         19        FETCH_DIM_R                                      ~19     !1, 'dat'
         20        SEND_VAL                                                 ~19
         21        DO_ICALL                                         $20     
         22        INIT_METHOD_CALL                                         $20, 'diff'
         23        SEND_VAR_EX                                              !3
         24        DO_FCALL                                      0  $21     
         25        INIT_METHOD_CALL                                         $21, 'format'
         26        SEND_VAL_EX                                              '%25a'
         27        DO_FCALL                                      0  $22     
         28        MUL                                              ~23     $22, -1
         29        ASSIGN                                                   !4, ~23
   12    30    >   MUL                                              ~25     !2, 2
         31        ADD                                              ~26     ~25, !4
         32        ASSIGN                                                   !5, ~26
   14    33        ASSIGN                                                   !6, !4
         34      > JMP                                                      ->38
   15    35    >   ASSIGN_DIM                                               !0
         36        OP_DATA                                                  !6
   14    37        PRE_INC                                                  !6
         38    >   IS_SMALLER_OR_EQUAL                                      !6, !5
         39      > JMPNZ                                                    ~31, ->35
   18    40    >   INIT_FCALL                                               'print_r'
         41        SEND_VAR                                                 !0
         42        DO_ICALL                                                 
         43      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.54 ms | 1400 KiB | 17 Q