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'; $rec = '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 = 33, Position 2 = 40
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 77
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 49
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
2 jumps found. (Code = 44) Position 1 = 76, Position 2 = 51
Branch analysis from position: 76
1 jumps found. (Code = 42) Position 1 = 86
Branch analysis from position: 86
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 51
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 69
Branch analysis from position: 68
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
Branch analysis from position: 69
2 jumps found. (Code = 44) Position 1 = 76, Position 2 = 51
Branch analysis from position: 76
Branch analysis from position: 51
Branch analysis from position: 49
Branch analysis from position: 77
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
filename:       /in/rRDDb
function name:  (null)
number of ops:  87
compiled vars:  !0 = $pay_date, !1 = $cutoff_date, !2 = $next_bill_date, !3 = $recurrence, !4 = $rec, !5 = $today, !6 = $outputstring, !7 = $days, !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'
    8     4        ASSIGN                                                   !4, '3'
   11     5        INIT_FCALL                                               'date_create'
          6        DO_ICALL                                         $17     
          7        ASSIGN                                                   !5, $17
   12     8        INIT_FCALL                                               'date_create_from_format'
          9        SEND_VAL                                                 'Ymd'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $19     
         12        ASSIGN                                                   !1, $19
   13    13        INIT_FCALL                                               'date_create_from_format'
         14        SEND_VAL                                                 'Ymd'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $21     
         17        ASSIGN                                                   !2, $21
   14    18        ASSIGN                                                   !0, !2
   17    19        INIT_METHOD_CALL                                         !0, 'format'
         20        SEND_VAL_EX                                              'Ymd'
         21        DO_FCALL                                      0  $24     
         22        ASSIGN                                                   !6, $24
   19    23        ECHO                                                     !6
   21    24        INIT_FCALL                                               'date_format'
         25        SEND_VAR                                                 !0
         26        SEND_VAL                                                 'j'
         27        DO_ICALL                                         $26     
         28        CAST                                          4  ~27     $26
         29        SUB                                              ~28     ~27, 1
         30        ASSIGN                                                   !7, ~28
   23    31        IS_SMALLER                                               0, !7
         32      > JMPZ                                                     ~30, ->40
   24    33    >   INIT_FCALL                                               'date_modify'
         34        SEND_VAR                                                 !0
         35        ROPE_INIT                                     3  ~32     '-'
         36        ROPE_ADD                                      1  ~32     ~32, !7
         37        ROPE_END                                      2  ~31     ~32, '+day'
         38        SEND_VAL                                                 ~31
         39        DO_ICALL                                                 
   27    40    >   IS_SMALLER                                               0, !4
         41      > JMPZ                                                     ~35, ->77
   28    42    >   ASSIGN                                                   !8, <array>
   34    43        IS_SMALLER                                               !1, !5
         44      > JMPZ                                                     ~37, ->49
   35    45    >   INIT_FCALL                                               'date_modify'
         46        SEND_VAR                                                 !0
         47        SEND_VAL                                                 '%2B1+month'
         48        DO_ICALL                                                 
   38    49    >   ASSIGN                                                   !9, 1
         50      > JMP                                                      ->74
   40    51    >   INIT_FCALL                                               'date_format'
         52        SEND_VAR                                                 !0
         53        SEND_VAL                                                 'n'
         54        DO_ICALL                                         $41     
         55        ASSIGN_DIM                                               !8, 'pay_month'
         56        OP_DATA                                                  $41
   41    57        INIT_FCALL                                               'date_format'
         58        SEND_VAR                                                 !0
         59        SEND_VAL                                                 'Y'
         60        DO_ICALL                                         $43     
         61        ASSIGN_DIM                                               !8, 'pay_year'
         62        OP_DATA                                                  $43
   42    63        INIT_FCALL                                               'print_r'
         64        SEND_VAR                                                 !8
         65        DO_ICALL                                                 
   44    66        IS_EQUAL                                                 !9, !4
         67      > JMPZ                                                     ~45, ->69
         68    > > JMP                                                      ->76
   46    69    >   INIT_FCALL                                               'date_modify'
         70        SEND_VAR                                                 !0
         71        SEND_VAL                                                 '%2B1+month'
         72        DO_ICALL                                                 
   38    73        PRE_INC                                                  !9
         74    >   IS_SMALLER_OR_EQUAL                                      !9, !4
         75      > JMPNZ                                                    ~48, ->51
         76    > > JMP                                                      ->86
   54    77    >   FETCH_DIM_R                                      ~49     !11, 'charity_id'
         78        INIT_ARRAY                                       ~50     ~49, 'charity_id'
   55    79        FETCH_DIM_R                                      ~51     !11, 'account'
         80        ADD_ARRAY_ELEMENT                                ~50     ~51, 'account_id'
   56    81        ADD_ARRAY_ELEMENT                                ~50     'Unselected+Charity+%3A+charity', 'action'
   53    82        ASSIGN                                                   !10, ~50
   59    83        INIT_FCALL                                               'print_r'
         84        SEND_VAR                                                 !10
         85        DO_ICALL                                                 
   60    86    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.13 ms | 1404 KiB | 23 Q