3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dates[] = array("date" => "2016-02-18 02:00:00", "duration" => "600"); // 10 mins $dates[] = array("date" => "2016-02-18 02:05:00", "duration" => "300"); // 5 mins $dates[] = array("date" => "2016-02-18 02:10:00", "duration" => "600"); $dates[] = array("date" => "2016-02-18 02:15:00", "duration" => "300"); $dates[] = array("date" => "2016-02-18 02:20:00", "duration" => "600"); $dates[] = array("date" => "2016-02-18 02:25:00", "duration" => "300"); $dates[] = array("date" => "2016-02-18 02:30:00", "duration" => "600"); $alreadyChosenDates[] = array("date" => "2016-02-18 02:10:00", "duration" => "600"); class ScheduleList { /** * A list of all the dates that: * 1) After the 'chosen' start date * 2) Do not overlap with any 'chosen' date * * @var array $candidates */ private $candidates = array(); /** * Any date record we didn't use. * * @var array $unused */ private $unused = array(); /** * List of dates that must be included in the 'final' list. * The earliest date is assumed to be a start date and everything must be later. * * @var array $chosen */ private $chosen = array(); /** * Ordered list of `none overlapping' dates from the chosen and candidates * * @var array $final */ private $final = array(); /** * These are the date lists. * They will be converted, sorted and filters as required. * * @param array $chosenDates * @param array $candidateDates * @return void */ public function __construct(array $chosenDates, array $candidateDates) { // convert and sort foreach ($chosenDates as $when) { $this->chosen[] = $this->makeDateRange($when); } if (count($this->chosen) > 1) { // sort them so we can easily compare against them usort($this->chosen, function ($when1, $when2) { return $when1['startTime'] - $when2['startTime']; }); } // add chosen to the final list $this->final = $this->chosen; // convert, sort and filter the candidates $this->convertCandidates($candidateDates); } /** * Add the candidates to the final list * * Known conditions: * o Both lists are in start date order * o No candidates overlap with any chosen date * o The candidates may overlap with each other - Hmm... need to check... * * Note: The '$this->isOverlapsAny' method - as it is used a lot will be expensive (O(n^2)) * I can think of ways to reduce that - will happen when it is refactored ;-/ * * @return array */ public function generateList() { // first candidate MUST be the closest to the first chosen date due to sorting. $this->final[] = array_shift($this->candidates); // move it to the final list // Add the remaining candidates checking for overlaps as we do so... foreach ($this->candidates as $candidate) { if ($this->isOverlapAny($candidate, $this->final)) { $this->unused[] = $candidate; } else { $this->final[] = $candidate; } } // sort final by start times - makes it easy to reason about usort($this->final, function ($when1, $when2) { return $when1['startTime'] - $when2['startTime']; }); return $this->final; } /* * Convert each date to a dateRange that is easier to check and display * * o Check each candidate date for ovelapping with any of the 'chosen dates' * o Check if before first chosen start data. */ protected function convertCandidates(array $candidateDates) { foreach ($candidateDates as $idx => $when) { $candidate = $this->makeDateRange($when); // overlaps with any chosen then ignore it if ($this->isOverlapAny($candidate, $this->chosen)) { // ignore it $this->unused[] = $candidate; // record failed ones so easy to check continue; } // ignore if before first chosen start time if ($candidate['endTime'] <= $this->chosen[0]['startTime']) { $this->unused[] = $candidate; // record failed ones so easy to check continue; } $this->candidates[] = $candidate; } // sort candidates by start times - makes it easy to reason about usort($this->candidates, function ($when1, $when2) { return $when1['startTime'] - $when2['startTime']; }); } /** * Convert to UNIX timestamp as seconds will make the calculations easier * * The result has: * 1) the time as a date object - I can do calculations / format it whatever * 2) startTime as epoch seconds * 3) endTime as epoch seconds * * @param array $when * * @return array */ public function makeDateRange(array $when) { $dt = \DateTime::createFromFormat('Y-m-d H:i:s', $when['date']); $result = array(); $result['when'] = $dt; $result['duration'] = (int) $when['duration']; $result['startTime'] = (int) $dt->format('U'); $result['endTime'] = (int) $result['startTime'] + $when['duration']; return $result; } /** * if start is after other end OR end is before other start then they don't overlap * * Easiest way is to check that they don't overlap and reverse the result */ public function isOverlap($when1, $when2) { return ! ( $when1['endTime'] <= $when2['startTime'] || $when1['startTime'] >= $when2['endTime']); } /** * Check if candidate overlaps any of the dates in the list * * @param array $candidate * @param array $whenList -- list of non-overlapping dates * * @return boolean true if overlaps */ function isOverlapAny($candidate, $whenList) { foreach ($whenList as $when) { if ($this->isOverlap($when, $candidate)) { // ignore it return true; } } return false; } /** * Show a date formatted for debugging purposes * * @param array $when * @return void */ public function displayWhen(array $when) { echo PHP_EOL, 'date: ', $when['when']->format('Y-m-d H:i:s'), ' len: ', $when['duration'], ' end: ', date('Y-m-d H:i:s', $when['endTime']), ' start: ', $when['startTime'], ' end: ', $when['endTime']; } /* * `Getters` so you can see what happened */ public function getChosen() { return $this->chosen; } public function getUnused() { return $this->unused; } public function getCandidates() { return $this->candidates; } public function getFinal() { return $this->final; } /** * properties - for those of us that like them */ public function __get($name) { if (property_exists($this, $name)) { return $this->$name; } return null; } } $datesListGenerator = new ScheduleList($alreadyChosenDates, $dates); $final = $datesListGenerator->generateList(); foreach ($datesListGenerator->getUnused() as $when) { $datesListGenerator->displayWhen($when); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 32
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 32
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/cRJXG
function name:  (null)
number of ops:  34
compiled vars:  !0 = $dates, !1 = $alreadyChosenDates, !2 = $datesListGenerator, !3 = $final, !4 = $when
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                               !0
          1        OP_DATA                                                  <array>
    4     2        ASSIGN_DIM                                               !0
          3        OP_DATA                                                  <array>
    5     4        ASSIGN_DIM                                               !0
          5        OP_DATA                                                  <array>
    6     6        ASSIGN_DIM                                               !0
          7        OP_DATA                                                  <array>
    7     8        ASSIGN_DIM                                               !0
          9        OP_DATA                                                  <array>
    8    10        ASSIGN_DIM                                               !0
         11        OP_DATA                                                  <array>
    9    12        ASSIGN_DIM                                               !0
         13        OP_DATA                                                  <array>
   11    14        ASSIGN_DIM                                               !1
         15        OP_DATA                                                  <array>
  236    16        NEW                                              $13     'ScheduleList'
         17        SEND_VAR_EX                                              !1
         18        SEND_VAR_EX                                              !0
         19        DO_FCALL                                      0          
         20        ASSIGN                                                   !2, $13
  237    21        INIT_METHOD_CALL                                         !2, 'generateList'
         22        DO_FCALL                                      0  $16     
         23        ASSIGN                                                   !3, $16
  239    24        INIT_METHOD_CALL                                         !2, 'getUnused'
         25        DO_FCALL                                      0  $18     
         26      > FE_RESET_R                                       $19     $18, ->32
         27    > > FE_FETCH_R                                               $19, !4, ->32
  240    28    >   INIT_METHOD_CALL                                         !2, 'displayWhen'
         29        SEND_VAR_EX                                              !4
         30        DO_FCALL                                      0          
  239    31      > JMP                                                      ->27
         32    >   FE_FREE                                                  $19
  241    33      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FcRJXG%3A64%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cRJXG
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $when1, !1 = $when2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   64     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   65     2        FETCH_DIM_R                                      ~2      !0, 'startTime'
          3        FETCH_DIM_R                                      ~3      !1, 'startTime'
          4        SUB                                              ~4      ~2, ~3
          5      > RETURN                                                   ~4
   66     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FcRJXG%3A64%240

Function %00%7Bclosure%7D%2Fin%2FcRJXG%3A107%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cRJXG
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $when1, !1 = $when2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  107     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  108     2        FETCH_DIM_R                                      ~2      !0, 'startTime'
          3        FETCH_DIM_R                                      ~3      !1, 'startTime'
          4        SUB                                              ~4      ~2, ~3
          5      > RETURN                                                   ~4
  109     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FcRJXG%3A107%241

Function %00%7Bclosure%7D%2Fin%2FcRJXG%3A143%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cRJXG
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $when1, !1 = $when2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  143     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  144     2        FETCH_DIM_R                                      ~2      !0, 'startTime'
          3        FETCH_DIM_R                                      ~3      !1, 'startTime'
          4        SUB                                              ~4      ~2, ~3
          5      > RETURN                                                   ~4
  145     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FcRJXG%3A143%242

Class ScheduleList:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Branch analysis from position: 11
filename:       /in/cRJXG
function name:  __construct
number of ops:  29
compiled vars:  !0 = $chosenDates, !1 = $candidateDates, !2 = $when
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   54     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   58     2      > FE_RESET_R                                       $3      !0, ->11
          3    > > FE_FETCH_R                                               $3, !2, ->11
   59     4    >   INIT_METHOD_CALL                                         'makeDateRange'
          5        SEND_VAR_EX                                              !2
          6        DO_FCALL                                      0  $6      
          7        FETCH_OBJ_W                                      $4      'chosen'
          8        ASSIGN_DIM                                               $4
          9        OP_DATA                                                  $6
   58    10      > JMP                                                      ->3
         11    >   FE_FREE                                                  $3
   62    12        FETCH_OBJ_R                                      ~7      'chosen'
         13        COUNT                                            ~8      ~7
         14        IS_SMALLER                                               1, ~8
         15      > JMPZ                                                     ~9, ->22
   63    16    >   INIT_FCALL                                               'usort'
         17        FETCH_OBJ_W                                      $10     'chosen'
         18        SEND_REF                                                 $10
   64    19        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FcRJXG%3A64%240'
   66    20        SEND_VAL                                                 ~11
         21        DO_ICALL                                                 
   70    22    >   FETCH_OBJ_R                                      ~14     'chosen'
         23        ASSIGN_OBJ                                               'final'
         24        OP_DATA                                                  ~14
   73    25        INIT_METHOD_CALL                                         'convertCandidates'
         26        SEND_VAR_EX                                              !1
         27        DO_FCALL                                      0          
   74    28      > RETURN                                                   null

End of function __construct

Function generatelist:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 25
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 25
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/cRJXG
function name:  generateList
number of ops:  35
compiled vars:  !0 = $candidate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   93     0  E >   INIT_FCALL                                               'array_shift'
          1        FETCH_OBJ_W                                      $3      'candidates'
          2        SEND_REF                                                 $3
          3        DO_ICALL                                         $4      
          4        FETCH_OBJ_W                                      $1      'final'
          5        ASSIGN_DIM                                               $1
          6        OP_DATA                                                  $4
   96     7        FETCH_OBJ_R                                      ~5      'candidates'
          8      > FE_RESET_R                                       $6      ~5, ->25
          9    > > FE_FETCH_R                                               $6, !0, ->25
   97    10    >   INIT_METHOD_CALL                                         'isOverlapAny'
         11        SEND_VAR_EX                                              !0
         12        CHECK_FUNC_ARG                                           
         13        FETCH_OBJ_FUNC_ARG                               $7      'final'
         14        SEND_FUNC_ARG                                            $7
         15        DO_FCALL                                      0  $8      
         16      > JMPZ                                                     $8, ->21
   98    17    >   FETCH_OBJ_W                                      $9      'unused'
         18        ASSIGN_DIM                                               $9
         19        OP_DATA                                                  !0
         20      > JMP                                                      ->24
  101    21    >   FETCH_OBJ_W                                      $11     'final'
         22        ASSIGN_DIM                                               $11
         23        OP_DATA                                                  !0
   96    24    > > JMP                                                      ->9
         25    >   FE_FREE                                                  $6
  106    26        INIT_FCALL                                               'usort'
         27        FETCH_OBJ_W                                      $13     'final'
         28        SEND_REF                                                 $13
  107    29        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FcRJXG%3A107%241'
  109    30        SEND_VAL                                                 ~14
         31        DO_ICALL                                                 
  111    32        FETCH_OBJ_R                                      ~16     'final'
         33      > RETURN                                                   ~16
  112    34*     > RETURN                                                   null

End of function generatelist

Function convertcandidates:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 33
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 33
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 19
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 29
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
filename:       /in/cRJXG
function name:  convertCandidates
number of ops:  41
compiled vars:  !0 = $candidateDates, !1 = $when, !2 = $idx, !3 = $candidate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  121     0  E >   RECV                                             !0      
  123     1      > FE_RESET_R                                       $4      !0, ->33
          2    > > FE_FETCH_R                                       ~5      $4, !1, ->33
          3    >   ASSIGN                                                   !2, ~5
  124     4        INIT_METHOD_CALL                                         'makeDateRange'
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0  $7      
          7        ASSIGN                                                   !3, $7
  127     8        INIT_METHOD_CALL                                         'isOverlapAny'
          9        SEND_VAR_EX                                              !3
         10        CHECK_FUNC_ARG                                           
         11        FETCH_OBJ_FUNC_ARG                               $9      'chosen'
         12        SEND_FUNC_ARG                                            $9
         13        DO_FCALL                                      0  $10     
         14      > JMPZ                                                     $10, ->19
  128    15    >   FETCH_OBJ_W                                      $11     'unused'
         16        ASSIGN_DIM                                               $11
         17        OP_DATA                                                  !3
  129    18      > JMP                                                      ->2
  133    19    >   FETCH_DIM_R                                      ~13     !3, 'endTime'
         20        FETCH_OBJ_R                                      ~14     'chosen'
         21        FETCH_DIM_R                                      ~15     ~14, 0
         22        FETCH_DIM_R                                      ~16     ~15, 'startTime'
         23        IS_SMALLER_OR_EQUAL                                      ~13, ~16
         24      > JMPZ                                                     ~17, ->29
  134    25    >   FETCH_OBJ_W                                      $18     'unused'
         26        ASSIGN_DIM                                               $18
         27        OP_DATA                                                  !3
  135    28      > JMP                                                      ->2
  138    29    >   FETCH_OBJ_W                                      $20     'candidates'
         30        ASSIGN_DIM                                               $20
         31        OP_DATA                                                  !3
  123    32      > JMP                                                      ->2
         33    >   FE_FREE                                                  $4
  142    34        INIT_FCALL                                               'usort'
         35        FETCH_OBJ_W                                      $22     'candidates'
         36        SEND_REF                                                 $22
  143    37        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FcRJXG%3A143%242'
  145    38        SEND_VAL                                                 ~23
         39        DO_ICALL                                                 
  146    40      > RETURN                                                   null

End of function convertcandidates

Function makedaterange:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cRJXG
function name:  makeDateRange
number of ops:  28
compiled vars:  !0 = $when, !1 = $dt, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  160     0  E >   RECV                                             !0      
  162     1        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          2        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
          3        FETCH_DIM_R                                      ~3      !0, 'date'
          4        SEND_VAL                                                 ~3
          5        DO_FCALL                                      0  $4      
          6        ASSIGN                                                   !1, $4
  163     7        ASSIGN                                                   !2, <array>
  164     8        ASSIGN_DIM                                               !2, 'when'
          9        OP_DATA                                                  !1
  165    10        FETCH_DIM_R                                      ~9      !0, 'duration'
         11        CAST                                          4  ~10     ~9
         12        ASSIGN_DIM                                               !2, 'duration'
         13        OP_DATA                                                  ~10
  166    14        INIT_METHOD_CALL                                         !1, 'format'
         15        SEND_VAL_EX                                              'U'
         16        DO_FCALL                                      0  $12     
         17        CAST                                          4  ~13     $12
         18        ASSIGN_DIM                                               !2, 'startTime'
         19        OP_DATA                                                  ~13
  167    20        FETCH_DIM_R                                      ~15     !2, 'startTime'
         21        CAST                                          4  ~16     ~15
         22        FETCH_DIM_R                                      ~17     !0, 'duration'
         23        ADD                                              ~18     ~16, ~17
         24        ASSIGN_DIM                                               !2, 'endTime'
         25        OP_DATA                                                  ~18
  169    26      > RETURN                                                   !2
  170    27*     > RETURN                                                   null

End of function makedaterange

Function isoverlap:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/cRJXG
function name:  isOverlap
number of ops:  13
compiled vars:  !0 = $when1, !1 = $when2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  177     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  179     2        FETCH_DIM_R                                      ~2      !0, 'endTime'
          3        FETCH_DIM_R                                      ~3      !1, 'startTime'
          4        IS_SMALLER_OR_EQUAL                              ~4      ~2, ~3
          5      > JMPNZ_EX                                         ~4      ~4, ->10
  180     6    >   FETCH_DIM_R                                      ~5      !0, 'startTime'
          7        FETCH_DIM_R                                      ~6      !1, 'endTime'
          8        IS_SMALLER_OR_EQUAL                              ~7      ~6, ~5
          9        BOOL                                             ~4      ~7
         10    >   BOOL_NOT                                         ~8      ~4
         11      > RETURN                                                   ~8
  181    12*     > RETURN                                                   null

End of function isoverlap

Function isoverlapany:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/cRJXG
function name:  isOverlapAny
number of ops:  15
compiled vars:  !0 = $candidate, !1 = $whenList, !2 = $when
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  191     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  193     2      > FE_RESET_R                                       $3      !1, ->12
          3    > > FE_FETCH_R                                               $3, !2, ->12
  194     4    >   INIT_METHOD_CALL                                         'isOverlap'
          5        SEND_VAR_EX                                              !2
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0  $4      
          8      > JMPZ                                                     $4, ->11
  195     9    >   FE_FREE                                                  $3
         10      > RETURN                                                   <true>
  193    11    > > JMP                                                      ->3
         12    >   FE_FREE                                                  $3
  198    13      > RETURN                                                   <false>
  199    14*     > RETURN                                                   null

End of function isoverlapany

Function displaywhen:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cRJXG
function name:  displayWhen
number of ops:  25
compiled vars:  !0 = $when
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  207     0  E >   RECV                                             !0      
  209     1        ECHO                                                     '%0A'
          2        ECHO                                                     'date%3A+'
          3        FETCH_DIM_R                                      ~1      !0, 'when'
          4        INIT_METHOD_CALL                                         ~1, 'format'
          5        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
          6        DO_FCALL                                      0  $2      
          7        ECHO                                                     $2
  210     8        ECHO                                                     '+len%3A+'
          9        FETCH_DIM_R                                      ~3      !0, 'duration'
         10        ECHO                                                     ~3
  211    11        ECHO                                                     '+end%3A+'
         12        INIT_FCALL                                               'date'
         13        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
         14        FETCH_DIM_R                                      ~4      !0, 'endTime'
         15        SEND_VAL                                                 ~4
         16        DO_ICALL                                         $5      
         17        ECHO                                                     $5
  212    18        ECHO                                                     '+start%3A+'
         19        FETCH_DIM_R                                      ~6      !0, 'startTime'
         20        ECHO                                                     ~6
  213    21        ECHO                                                     '+end%3A+'
         22        FETCH_DIM_R                                      ~7      !0, 'endTime'
         23        ECHO                                                     ~7
  214    24      > RETURN                                                   null

End of function displaywhen

Function getchosen:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cRJXG
function name:  getChosen
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  219     0  E >   FETCH_OBJ_R                                      ~0      'chosen'
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function getchosen

Function getunused:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cRJXG
function name:  getUnused
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  220     0  E >   FETCH_OBJ_R                                      ~0      'unused'
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function getunused

Function getcandidates:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cRJXG
function name:  getCandidates
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  221     0  E >   FETCH_OBJ_R                                      ~0      'candidates'
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function getcandidates

Function getfinal:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cRJXG
function name:  getFinal
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  222     0  E >   FETCH_OBJ_R                                      ~0      'final'
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function getfinal

Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cRJXG
function name:  __get
number of ops:  11
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  227     0  E >   RECV                                             !0      
  229     1        INIT_FCALL                                               'property_exists'
          2        FETCH_THIS                                       ~1      
          3        SEND_VAL                                                 ~1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6      > JMPZ                                                     $2, ->9
  230     7    >   FETCH_OBJ_R                                      ~3      !0
          8      > RETURN                                                   ~3
  232     9    > > RETURN                                                   null
  233    10*     > RETURN                                                   null

End of function __get

End of class ScheduleList.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.1 ms | 1424 KiB | 21 Q