3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Enter your code here, enjoy! $pay_date = '20140808'; $cutoff_date = '20140728'; $next_bill_date = '20140808'; $recurrence = '3'; $today = date_create(); $cutoff_date = date_create_from_format('Ymd',$cutoff_date); $next_bill_date = date_create_from_format('Ymd',$next_bill_date); $pay_date = $next_bill_date; $outputstring = $pay_date->format('Ymd'); echo $outputstring; $days = ((int)date_format($pay_date, 'j'))-1; if ( $days > 0 ) { date_modify($pay_date, "-$days day"); } if($rec > 0){ $history = array ( 'account_id' => 'account', 'pay_amount' => '20.00', 'charity_id' => 'charity' ); if ($today > $cutoff_date) { date_modify($pay_date, '+1 month'); } for( $i = 1; $i <= $rec; ++$i ) { $history['pay_month'] = date_format($pay_date,'n'); $history['pay_year'] = date_format($pay_date,'Y'); print_r($history); if ( $i == $rec ) break; date_modify($pay_date, '+1 month'); } } else { $newData = array( 'charity_id' => $data['charity_id'], 'account_id' => $data['account'], 'action' => 'Unselected Charity : charity' ); print_r($newData); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 39
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 76
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 48
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
2 jumps found. (Code = 44) Position 1 = 75, Position 2 = 50
Branch analysis from position: 75
1 jumps found. (Code = 42) Position 1 = 85
Branch analysis from position: 85
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 67, Position 2 = 68
Branch analysis from position: 67
1 jumps found. (Code = 42) Position 1 = 75
Branch analysis from position: 75
Branch analysis from position: 68
2 jumps found. (Code = 44) Position 1 = 75, Position 2 = 50
Branch analysis from position: 75
Branch analysis from position: 50
Branch analysis from position: 48
Branch analysis from position: 76
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
filename:       /in/KqAHX
function name:  (null)
number of ops:  86
compiled vars:  !0 = $pay_date, !1 = $cutoff_date, !2 = $next_bill_date, !3 = $recurrence, !4 = $today, !5 = $outputstring, !6 = $days, !7 = $rec, !8 = $history, !9 = $i, !10 = $newData, !11 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, '20140808'
    5     1        ASSIGN                                                   !1, '20140728'
    6     2        ASSIGN                                                   !2, '20140808'
    7     3        ASSIGN                                                   !3, '3'
   10     4        INIT_FCALL                                               'date_create'
          5        DO_ICALL                                         $16     
          6        ASSIGN                                                   !4, $16
   11     7        INIT_FCALL                                               'date_create_from_format'
          8        SEND_VAL                                                 'Ymd'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $18     
         11        ASSIGN                                                   !1, $18
   12    12        INIT_FCALL                                               'date_create_from_format'
         13        SEND_VAL                                                 'Ymd'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $20     
         16        ASSIGN                                                   !2, $20
   13    17        ASSIGN                                                   !0, !2
   16    18        INIT_METHOD_CALL                                         !0, 'format'
         19        SEND_VAL_EX                                              'Ymd'
         20        DO_FCALL                                      0  $23     
         21        ASSIGN                                                   !5, $23
   18    22        ECHO                                                     !5
   20    23        INIT_FCALL                                               'date_format'
         24        SEND_VAR                                                 !0
         25        SEND_VAL                                                 'j'
         26        DO_ICALL                                         $25     
         27        CAST                                          4  ~26     $25
         28        SUB                                              ~27     ~26, 1
         29        ASSIGN                                                   !6, ~27
   22    30        IS_SMALLER                                               0, !6
         31      > JMPZ                                                     ~29, ->39
   23    32    >   INIT_FCALL                                               'date_modify'
         33        SEND_VAR                                                 !0
         34        ROPE_INIT                                     3  ~31     '-'
         35        ROPE_ADD                                      1  ~31     ~31, !6
         36        ROPE_END                                      2  ~30     ~31, '+day'
         37        SEND_VAL                                                 ~30
         38        DO_ICALL                                                 
   26    39    >   IS_SMALLER                                               0, !7
         40      > JMPZ                                                     ~34, ->76
   27    41    >   ASSIGN                                                   !8, <array>
   33    42        IS_SMALLER                                               !1, !4
         43      > JMPZ                                                     ~36, ->48
   34    44    >   INIT_FCALL                                               'date_modify'
         45        SEND_VAR                                                 !0
         46        SEND_VAL                                                 '%2B1+month'
         47        DO_ICALL                                                 
   37    48    >   ASSIGN                                                   !9, 1
         49      > JMP                                                      ->73
   39    50    >   INIT_FCALL                                               'date_format'
         51        SEND_VAR                                                 !0
         52        SEND_VAL                                                 'n'
         53        DO_ICALL                                         $40     
         54        ASSIGN_DIM                                               !8, 'pay_month'
         55        OP_DATA                                                  $40
   40    56        INIT_FCALL                                               'date_format'
         57        SEND_VAR                                                 !0
         58        SEND_VAL                                                 'Y'
         59        DO_ICALL                                         $42     
         60        ASSIGN_DIM                                               !8, 'pay_year'
         61        OP_DATA                                                  $42
   41    62        INIT_FCALL                                               'print_r'
         63        SEND_VAR                                                 !8
         64        DO_ICALL                                                 
   43    65        IS_EQUAL                                                 !9, !7
         66      > JMPZ                                                     ~44, ->68
         67    > > JMP                                                      ->75
   45    68    >   INIT_FCALL                                               'date_modify'
         69        SEND_VAR                                                 !0
         70        SEND_VAL                                                 '%2B1+month'
         71        DO_ICALL                                                 
   37    72        PRE_INC                                                  !9
         73    >   IS_SMALLER_OR_EQUAL                                      !9, !7
         74      > JMPNZ                                                    ~47, ->50
         75    > > JMP                                                      ->85
   53    76    >   FETCH_DIM_R                                      ~48     !11, 'charity_id'
         77        INIT_ARRAY                                       ~49     ~48, 'charity_id'
   54    78        FETCH_DIM_R                                      ~50     !11, 'account'
         79        ADD_ARRAY_ELEMENT                                ~49     ~50, 'account_id'
   55    80        ADD_ARRAY_ELEMENT                                ~49     'Unselected+Charity+%3A+charity', 'action'
   52    81        ASSIGN                                                   !10, ~49
   58    82        INIT_FCALL                                               'print_r'
         83        SEND_VAR                                                 !10
         84        DO_ICALL                                                 
   59    85    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.21 ms | 1404 KiB | 23 Q