3v4l.org

run code in 300+ PHP versions simultaneously
<?php // define some rules here for now $rules = new StdClass(); $rules->nfl = '+ 3 hours'; $rules->cf = '+ 3 hours'; $rules->nba = '+ 2 hours 30 minutes'; $rules->mcb = '+ 2 hours'; $rules->mlb = '+ 3 hours'; $rules->football = '+ 2 hours'; $event_date = '2016-12-12'; $start_time = new dateTime((string)$event_date.' 12:00:00'); $end_time = new dateTime((string)$event_date.' 12:00:00'); $end_time->modify( $rules->football ); // HERE APPLY RULE ACCORDINGLY *** echo $end_time; exit; // $event_date = strtotime($event->event_date); // $event_date = date('Y-m-d 12:00:00', $event->event_date); $insert_schedule = 'INSERT INTO '.$tables->schedulesTable.' ( ID, eventID, start_time, end_time, recurring_time, recurring_event ) VALUES ( NULL, :eventID, :start_time, :end_time, :recurring_time, :recurring_event )'; $data3['eventID'] = $new_event_id; $data3['start_time'] = $start_time; $data3['end_time'] = $end_time->format('Y-m-d H:i:s'); $data3['recurring_time'] = NULL; $data3['recurring_event'] = 0;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/NichM
function name:  (null)
number of ops:  53
compiled vars:  !0 = $rules, !1 = $event_date, !2 = $start_time, !3 = $end_time, !4 = $insert_schedule, !5 = $tables, !6 = $data3, !7 = $new_event_id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $8      'StdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $8
    4     3        ASSIGN_OBJ                                               !0, 'nfl'
          4        OP_DATA                                                  '%2B+3+hours'
    5     5        ASSIGN_OBJ                                               !0, 'cf'
          6        OP_DATA                                                  '%2B+3+hours'
    6     7        ASSIGN_OBJ                                               !0, 'nba'
          8        OP_DATA                                                  '%2B+2+hours+30+minutes'
    7     9        ASSIGN_OBJ                                               !0, 'mcb'
         10        OP_DATA                                                  '%2B+2+hours'
    8    11        ASSIGN_OBJ                                               !0, 'mlb'
         12        OP_DATA                                                  '%2B+3+hours'
    9    13        ASSIGN_OBJ                                               !0, 'football'
         14        OP_DATA                                                  '%2B+2+hours'
   11    15        ASSIGN                                                   !1, '2016-12-12'
   12    16        NEW                                              $18     'dateTime'
         17        CAST                                          6  ~19     !1
         18        CONCAT                                           ~20     ~19, '+12%3A00%3A00'
         19        SEND_VAL_EX                                              ~20
         20        DO_FCALL                                      0          
         21        ASSIGN                                                   !2, $18
   13    22        NEW                                              $23     'dateTime'
         23        CAST                                          6  ~24     !1
         24        CONCAT                                           ~25     ~24, '+12%3A00%3A00'
         25        SEND_VAL_EX                                              ~25
         26        DO_FCALL                                      0          
         27        ASSIGN                                                   !3, $23
   15    28        INIT_METHOD_CALL                                         !3, 'modify'
         29        CHECK_FUNC_ARG                                           
         30        FETCH_OBJ_FUNC_ARG                               $28     !0, 'football'
         31        SEND_FUNC_ARG                                            $28
         32        DO_FCALL                                      0          
   16    33        ECHO                                                     !3
         34      > EXIT                                                     
   22    35*       FETCH_OBJ_R                                      ~30     !5, 'schedulesTable'
         36*       CONCAT                                           ~31     'INSERT+INTO+', ~30
         37*       CONCAT                                           ~32     ~31, '+%0A%09%09%28+ID%2C+eventID%2C+start_time%2C+end_time%2C+recurring_time%2C+recurring_event+%29%0A%09%09VALUES%0A%09%09%28+NULL%2C+%3AeventID%2C+%3Astart_time%2C+%3Aend_time%2C+%3Arecurring_time%2C+%3Arecurring_event+%29'
         38*       ASSIGN                                                   !4, ~32
   28    39*       ASSIGN_DIM                                               !6, 'eventID'
         40*       OP_DATA                                                  !7
   29    41*       ASSIGN_DIM                                               !6, 'start_time'
         42*       OP_DATA                                                  !2
   30    43*       INIT_METHOD_CALL                                         !3, 'format'
         44*       SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         45*       DO_FCALL                                      0  $37     
         46*       ASSIGN_DIM                                               !6, 'end_time'
         47*       OP_DATA                                                  $37
   31    48*       ASSIGN_DIM                                               !6, 'recurring_time'
         49*       OP_DATA                                                  null
   32    50*       ASSIGN_DIM                                               !6, 'recurring_event'
         51*       OP_DATA                                                  0
         52*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.69 ms | 1390 KiB | 13 Q