3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types = 1); $disabledDay = new DateTimeImmutable('2026-07-06'); // day DD was disabled $enableDay = new DateTimeImmutable('today'); // last day for witch import should run $path = '/home/users/slevomat/slevomat.cz/version/20260802212854'; $parts = ['bank']; $otherIncomeStart = $disabledDay->modify('-1 day'); $bankStart = $disabledDay; $bankFinal = $enableDay->modify('-5 days'); $otherIncomeFinal = $enableDay->modify('-1 day'); $since = min($otherIncomeStart, $bankStart); $partOptions = array_filter(array_map(function(string $part): string {return in_array($part, ["bank", "vcn"]) ? '' : ' --part='.$part;}, $parts ?? [])); while ($since <= max($bankFinal, $otherIncomeFinal)) { if (in_array('bank', $parts, true) && $since <= $bankFinal && $since > $bankStart) { $commands[] = sprintf('echo "%1$s bank" && %2$s/bin/cli --memory-limit=6G abra:daily-dose:bank -vvv -- "%1$s"', $since->format('Y-m-d'), $path); } if (in_array('vcn', $parts, true) && $since <= $bankFinal && $since > $bankStart) { $commands[] = sprintf('echo "%1$s vcn" && %2$s/bin/cli abra:import-virtual-cards -vvv -- "%1$s"', $since->format('Y-m-d'), $path); } if (count(array_intersect(['obligations', 'giftcards', 'earnings'], $parts)) !== 0 && $since <= $otherIncomeFinal && $since > $otherIncomeStart) { $commands[] = sprintf('echo "%1$s other income" && %2$s/bin/cli --memory-limit=6G abra:daily-dose:other-income%3$s -vvv -- "%1$s"', $since->format('Y-m-d'), $path, implode('', $partOptions)); } $since = $since->modify('+1 day'); } echo '#!/bin/bash'."\n\n"; echo implode(" && \\\n", $commands);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 104
Branch analysis from position: 104
2 jumps found. (Code = 44) Position 1 = 107, Position 2 = 37
Branch analysis from position: 107
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
2 jumps found. (Code = 46) Position 1 = 40, Position 2 = 42
Branch analysis from position: 40
2 jumps found. (Code = 46) Position 1 = 43, Position 2 = 45
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 56
Branch analysis from position: 46
2 jumps found. (Code = 46) Position 1 = 59, Position 2 = 61
Branch analysis from position: 59
2 jumps found. (Code = 46) Position 1 = 62, Position 2 = 64
Branch analysis from position: 62
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 75
Branch analysis from position: 65
2 jumps found. (Code = 46) Position 1 = 82, Position 2 = 84
Branch analysis from position: 82
2 jumps found. (Code = 46) Position 1 = 85, Position 2 = 87
Branch analysis from position: 85
2 jumps found. (Code = 43) Position 1 = 88, Position 2 = 100
Branch analysis from position: 88
2 jumps found. (Code = 44) Position 1 = 107, Position 2 = 37
Branch analysis from position: 107
Branch analysis from position: 37
Branch analysis from position: 100
Branch analysis from position: 87
Branch analysis from position: 84
Branch analysis from position: 75
Branch analysis from position: 64
Branch analysis from position: 61
Branch analysis from position: 56
Branch analysis from position: 45
Branch analysis from position: 42
filename:       /in/NNugU
function name:  (null)
number of ops:  111
compiled vars:  !0 = $disabledDay, !1 = $enableDay, !2 = $path, !3 = $parts, !4 = $otherIncomeStart, !5 = $bankStart, !6 = $bankFinal, !7 = $otherIncomeFinal, !8 = $since, !9 = $partOptions, !10 = $commands
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   NEW                                                  $11     'DateTimeImmutable'
          1        SEND_VAL_EX                                                  '2026-07-06'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $11
    4     4        NEW                                                  $14     'DateTimeImmutable'
          5        SEND_VAL_EX                                                  'today'
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !1, $14
    5     8        ASSIGN                                                       !2, '%2Fhome%2Fusers%2Fslevomat%2Fslevomat.cz%2Fversion%2F20260802212854'
    6     9        ASSIGN                                                       !3, <array>
    8    10        INIT_METHOD_CALL                                             !0, 'modify'
         11        SEND_VAL_EX                                                  '-1+day'
         12        DO_FCALL                                          0  $19     
         13        ASSIGN                                                       !4, $19
    9    14        ASSIGN                                                       !5, !0
   11    15        INIT_METHOD_CALL                                             !1, 'modify'
         16        SEND_VAL_EX                                                  '-5+days'
         17        DO_FCALL                                          0  $22     
         18        ASSIGN                                                       !6, $22
   12    19        INIT_METHOD_CALL                                             !1, 'modify'
         20        SEND_VAL_EX                                                  '-1+day'
         21        DO_FCALL                                          0  $24     
         22        ASSIGN                                                       !7, $24
   14    23        FRAMELESS_ICALL_2                min                 ~26     !4, !5
         24        ASSIGN                                                       !8, ~26
   16    25        INIT_FCALL                                                   'array_filter'
         26        INIT_FCALL                                                   'array_map'
         27        DECLARE_LAMBDA_FUNCTION                              ~28     [0]
         28        SEND_VAL                                                     ~28
         29        COALESCE                                             ~29     !3
         30        QM_ASSIGN                                            ~29     <array>
         31        SEND_VAL                                                     ~29
         32        DO_ICALL                                             $30     
         33        SEND_VAR                                                     $30
         34        DO_ICALL                                             $31     
         35        ASSIGN                                                       !9, $31
   18    36      > JMP                                                          ->104
   19    37    >   FRAMELESS_ICALL_3                in_array            ~33     'bank', !3
         38        OP_DATA                                                      <true>
         39      > JMPZ_EX                                              ~33     ~33, ->42
         40    >   IS_SMALLER_OR_EQUAL                                  ~34     !8, !6
         41        BOOL                                                 ~33     ~34
         42    > > JMPZ_EX                                              ~33     ~33, ->45
         43    >   IS_SMALLER                                           ~35     !5, !8
         44        BOOL                                                 ~33     ~35
         45    > > JMPZ                                                         ~33, ->56
   20    46    >   INIT_FCALL                                                   'sprintf'
         47        SEND_VAL                                                     'echo+%22%251%24s+bank%22+%26%26+%252%24s%2Fbin%2Fcli+--memory-limit%3D6G+abra%3Adaily-dose%3Abank+-vvv+--+%22%251%24s%22'
         48        INIT_METHOD_CALL                                             !8, 'format'
         49        SEND_VAL_EX                                                  'Y-m-d'
         50        DO_FCALL                                          0  $37     
         51        SEND_VAR                                                     $37
         52        SEND_VAR                                                     !2
         53        DO_ICALL                                             $38     
         54        ASSIGN_DIM                                                   !10
         55        OP_DATA                                                      $38
   22    56    >   FRAMELESS_ICALL_3                in_array            ~39     'vcn', !3
         57        OP_DATA                                                      <true>
         58      > JMPZ_EX                                              ~39     ~39, ->61
         59    >   IS_SMALLER_OR_EQUAL                                  ~40     !8, !6
         60        BOOL                                                 ~39     ~40
         61    > > JMPZ_EX                                              ~39     ~39, ->64
         62    >   IS_SMALLER                                           ~41     !5, !8
         63        BOOL                                                 ~39     ~41
         64    > > JMPZ                                                         ~39, ->75
   23    65    >   INIT_FCALL                                                   'sprintf'
         66        SEND_VAL                                                     'echo+%22%251%24s+vcn%22+%26%26+%252%24s%2Fbin%2Fcli+abra%3Aimport-virtual-cards+-vvv+--+%22%251%24s%22'
         67        INIT_METHOD_CALL                                             !8, 'format'
         68        SEND_VAL_EX                                                  'Y-m-d'
         69        DO_FCALL                                          0  $43     
         70        SEND_VAR                                                     $43
         71        SEND_VAR                                                     !2
         72        DO_ICALL                                             $44     
         73        ASSIGN_DIM                                                   !10
         74        OP_DATA                                                      $44
   25    75    >   INIT_FCALL                                                   'array_intersect'
         76        SEND_VAL                                                     <array>
         77        SEND_VAR                                                     !3
         78        DO_ICALL                                             $45     
         79        COUNT                                                ~46     $45
         80        IS_NOT_IDENTICAL                                     ~47     ~46, 0
         81      > JMPZ_EX                                              ~47     ~47, ->84
         82    >   IS_SMALLER_OR_EQUAL                                  ~48     !8, !7
         83        BOOL                                                 ~47     ~48
         84    > > JMPZ_EX                                              ~47     ~47, ->87
         85    >   IS_SMALLER                                           ~49     !4, !8
         86        BOOL                                                 ~47     ~49
         87    > > JMPZ                                                         ~47, ->100
   26    88    >   INIT_FCALL                                                   'sprintf'
         89        SEND_VAL                                                     'echo+%22%251%24s+other+income%22+%26%26+%252%24s%2Fbin%2Fcli+--memory-limit%3D6G+abra%3Adaily-dose%3Aother-income%253%24s+-vvv+--+%22%251%24s%22'
         90        INIT_METHOD_CALL                                             !8, 'format'
         91        SEND_VAL_EX                                                  'Y-m-d'
         92        DO_FCALL                                          0  $51     
         93        SEND_VAR                                                     $51
         94        SEND_VAR                                                     !2
         95        FRAMELESS_ICALL_2                implode             ~52     '', !9
         96        SEND_VAL                                                     ~52
         97        DO_ICALL                                             $53     
         98        ASSIGN_DIM                                                   !10
         99        OP_DATA                                                      $53
   28   100    >   INIT_METHOD_CALL                                             !8, 'modify'
        101        SEND_VAL_EX                                                  '%2B1+day'
        102        DO_FCALL                                          0  $54     
        103        ASSIGN                                                       !8, $54
   18   104    >   FRAMELESS_ICALL_2                max                 ~56     !6, !7
        105        IS_SMALLER_OR_EQUAL                                          !8, ~56
        106      > JMPNZ                                                        ~57, ->37
   30   107    >   ECHO                                                         '%23%21%2Fbin%2Fbash%0A%0A'
   31   108        FRAMELESS_ICALL_2                implode             ~58     '+%26%26+%5C%0A', !10
        109        ECHO                                                         ~58
        110      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NNugU
function name:  {closure:/in/NNugU:16}
number of ops:  11
compiled vars:  !0 = $part
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   RECV                                                 !0      
          1        IN_ARRAY                                                     !0, <array>
          2      > JMPZ                                                         ~1, ->5
          3    >   QM_ASSIGN                                            ~2      ''
          4      > JMP                                                          ->7
          5    >   CONCAT                                               ~3      '+--part%3D', !0
          6        QM_ASSIGN                                            ~2      ~3
          7    >   VERIFY_RETURN_TYPE                                           ~2
          8      > RETURN                                                       ~2
          9*       VERIFY_RETURN_TYPE                                           
         10*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.71 ms | 1713 KiB | 17 Q