3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Fisharebest\ExtCalendar; /** * interface CalendarInterface - each calendar implementation needs to provide * these methods. * * @author Greg Roach <fisharebest@gmail.com> * @copyright (c) 2014 Greg Roach * @license This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ interface CalendarInterface { public function daysInMonth($year, $month); public function dayOfWeek($jd); public function jdToYmd($jd); public function leapYear($year); public function ymdToJd($year, $month, $day); } /** * class Calendar - generic base class for specific calendars. * * @author Greg Roach <fisharebest@gmail.com> * @copyright (c) 2014 Greg Roach * @license This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ abstract class Calendar { /** Same as PHP’s ext/calendar extension */ const PHP_CALENDAR_NAME = 'Undefined'; /** Same as PHP’s ext/calendar extension */ const PHP_CALENDAR_NUMBER = -1; /** Same as PHP’s ext/calendar extension */ const PHP_CALENDAR_SYMBOL = 'CAL_UNDEFINED'; /** See the GEDCOM specification */ const GEDCOM_CALENDAR_ESCAPE = '@#DUNKNOWN@'; /** The earliest Julian Day number that can be converted into this calendar. */ const JD_START = 1; /** The latest Julian Day number that can be converted into this calendar. */ const JD_END = 2147483647; /** The maximum number of months in any year */ const MAX_MONTHS_IN_YEAR = 12; /** The maximum number of days in any month */ const MAX_DAYS_IN_MONTH = 31; /** * The concrete class needs to provide the implementation. * * @return string[] */ protected abstract function monthNames(); /** * English names for the days of the week. * * @return string[] */ protected function dayNames() { return array( 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ); } /** * Abbreviated English names for the days of the week. * * @return string[] */ protected function dayNamesAbbreviated() { return array( 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', ); } /** * Convert a Julian Day number into a calendar date. * * @param $jd * @return int[] Array of month, day and year */ public function calFromJd($jd) { $dow = $this->dayOfWeek($jd); if ($jd >= static::JD_START && $jd <= static::JD_END) { list($year, $month, $day) = $this->jdToYmd($jd); return array( 'date' => $month . '/' . $day . '/' . $year, 'month' => $month, 'day' => $day, 'year' => $year, 'dow' => $dow, 'abbrevdayname' => $this->dayNameAbbreviated($dow), 'dayname' => $this->dayName($dow), 'abbrevmonth' => $this->jdMonthNameAbbreviated($jd), 'monthname' => $this->jdMonthName($jd), ); } else { return array( 'date' => '0/0/0', 'month' => 0, 'day' => 0, 'year' => 0, 'dow' => $dow, 'abbrevdayname' => $this->dayNameAbbreviated($dow), 'dayname' => $this->dayName($dow), 'abbrevmonth' => '', 'monthname' => '', ); } } /** * Provide information about this calendar. * * @return array */ public function phpCalInfo() { return array( 'months' => $this->monthNames(), 'abbrevmonths' => $this->monthNamesAbbreviated(), 'maxdaysinmonth' => static::MAX_DAYS_IN_MONTH, 'calname' => static::PHP_CALENDAR_NAME, 'calsymbol' => static::PHP_CALENDAR_SYMBOL, ); } /** * Calculate the day of the week for a given Julian Day number. * * @param int $jd * * @return int 0=Sunday ... 6=Saturday */ public function dayOfWeek($jd) { $dow = ($jd + 1) % 7; if ($dow < 0) { return $dow + 7; } else { return $dow; } } /** * English name for a day of the week. * * @param int $dow Day of the week * * @return string */ public function dayName($dow) { $days = $this->dayNames(); return $days[$dow]; } /** * Abbreviated English name for a day of the week. * * @param int $dow Day of the week * * @return string */ public function dayNameAbbreviated($dow) { $days = $this->dayNamesAbbreviated(); return $days[$dow]; } /** * Calculate the name of a month, for a specified Julian Day number. * * @param $jd * * @return string */ public function jdMonthName($jd) { list(, $month) = $this->jdToYmd($jd); $months = $this->monthNames(); return $months[$month]; } /** * Calculate the name of a month, for a specified Julian Day number. * * @param int $jd * * @return string */ public function jdMonthNameAbbreviated($jd) { list(, $month) = $this->jdToYmd($jd); $months = $this->monthNamesAbbreviated(); return $months[$month]; } /** * Unless otherwise defined, abbreviated month names are the same as full names. * * @return string[] */ public function monthNamesAbbreviated() { return $this->monthNames(); } } /** * class JulianCalendar - calculations for the Julian calendar. * * @author Greg Roach <fisharebest@gmail.com> * @copyright (c) 2014 Greg Roach * @license This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ class JulianCalendar extends Calendar implements CalendarInterface { /** Same as PHP’s ext/calendar extension */ const PHP_CALENDAR_NAME = 'Julian'; /** Same as PHP’s ext/calendar extension */ const PHP_CALENDAR_NUMBER = 1; /** Same as PHP’s ext/calendar extension */ const PHP_CALENDAR_SYMBOL = 'CAL_JULIAN'; /** See the GEDCOM specification */ const GEDCOM_CALENDAR_ESCAPE = '@#DJULIAN@'; /** * Month lengths for regular years and leap-years. * * @var int[][] */ protected static $DAYS_IN_MONTH = array( 0 => array(1 => 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31), 1 => array(1 => 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31), ); /** * English month names. * * @return string[] */ public function monthNames() { return array( 1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ); } /** * Abbreviated English month names. * * @return string[] */ public function monthNamesAbbreviated() { return array( 1 => 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', ); } /** * Determine whether a year is a leap year. * * @param int $year * @return bool */ public function leapYear($year) { if ($year < 0) { $year++; } return $year % 4 == 0; } /** * Convert a Julian day number into a year/month/day. * * @param $jd * * @return int[]; */ public function jdToYmd($jd) { $c = $jd + 32082; $d = (int)((4 * $c + 3) / 1461); $e = $c - (int)(1461 * $d / 4); $m = (int)((5 * $e + 2) / 153); $day = $e - (int)((153 * $m + 2) / 5) + 1; $month = $m + 3 - 12 * (int)($m / 10); $year = $d - 4800 + (int)($m / 10); if ($year < 1) { // 0=1BC, -1=2BC, etc. $year--; } return array($year, $month, $day); } /** * Convert a year/month/day into a Julian day number * * @param int $year * @param int $month * @param int $day * * @return int */ public function ymdToJd($year, $month, $day) { if ($year < 0) { // 1 B.C.E. => 0, 2 B.C.E> => 1, etc. ++$year; } $a = (int)((14 - $month) / 12); $year = $year + 4800 - $a; $month = $month + 12 * $a - 3; return $day + (int)((153 * $month + 2) / 5) + 365 * $year + (int)($year / 4) - 32083; } /** * Calculate the number of days in a month. * * @param int $year * @param int $month * * @return int */ public function daysInMonth($year, $month) { if ($year == 0 || $month < 1 || $month > 12) { return trigger_error('invalid date.', E_USER_WARNING); } else { return static::$DAYS_IN_MONTH[$this->leapYear($year)][$month]; } } /** * Get the number of days after March 21 that easter falls, for a given year. * * Uses the algorithm found in PHP’s ext/calendar/easter.c * * @param int $year * * @return int */ public function easterDays($year) { // The “golden” number $golden = 1 + $year % 19; // The “dominical” number (finding a Sunday) $dom = ($year + (int)($year / 4) + 5) % 7; if ($dom < 0) { $dom += 7; } // The uncorrected “Paschal full moon” date $pfm = (3 - 11 * $golden - 7) % 30; if ($pfm < 0) { $pfm += 30; } // The corrected “Paschal full moon” date if ($pfm == 29 || $pfm == 28 && $golden > 11) { $pfm--; } $tmp = (4 - $pfm - $dom) % 7; if ($tmp < 0) { $tmp += 7; } return $pfm + $tmp + 1; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i9qdO
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  254     0  E >   DECLARE_CLASS                                            'fisharebest%5Cextcalendar%5Cjuliancalendar', 'fisharebest%5Cextcalendar%5Ccalendar'
  411     1      > RETURN                                                   1

Class Fisharebest\ExtCalendar\CalendarInterface:
Function daysinmonth:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i9qdO
function name:  daysInMonth
number of ops:  3
compiled vars:  !0 = $year, !1 = $month
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2      > RETURN                                                   null

End of function daysinmonth

Function dayofweek:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i9qdO
function name:  dayOfWeek
number of ops:  2
compiled vars:  !0 = $jd
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function dayofweek

Function jdtoymd:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i9qdO
function name:  jdToYmd
number of ops:  2
compiled vars:  !0 = $jd
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function jdtoymd

Function leapyear:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i9qdO
function name:  leapYear
number of ops:  2
compiled vars:  !0 = $year
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function leapyear

Function ymdtojd:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i9qdO
function name:  ymdToJd
number of ops:  4
compiled vars:  !0 = $year, !1 = $month, !2 = $day
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3      > RETURN                                                   null

End of function ymdtojd

End of class Fisharebest\ExtCalendar\CalendarInterface.

Class Fisharebest\ExtCalendar\Calendar:
Function monthnames:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i9qdO
function name:  monthNames
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   79     0  E > > RETURN                                                   null

End of function monthnames

Function daynames:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i9qdO
function name:  dayNames
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   88     0  E > > RETURN                                                   <array>
   90     1*     > RETURN                                                   null

End of function daynames

Function daynamesabbreviated:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i9qdO
function name:  dayNamesAbbreviated
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   99     0  E > > RETURN                                                   <array>
  101     1*     > RETURN                                                   null

End of function daynamesabbreviated

Function calfromjd:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 49
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/i9qdO
function name:  calFromJd
number of ops:  66
compiled vars:  !0 = $jd, !1 = $dow, !2 = $year, !3 = $month, !4 = $day
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  109     0  E >   RECV                                             !0      
  110     1        INIT_METHOD_CALL                                         'dayOfWeek'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $5      
          4        ASSIGN                                                   !1, $5
  112     5        FETCH_CLASS_CONSTANT                             ~7      'JD_START'
          6        IS_SMALLER_OR_EQUAL                              ~8      ~7, !0
          7      > JMPZ_EX                                          ~8      ~8, ->11
          8    >   FETCH_CLASS_CONSTANT                             ~9      'JD_END'
          9        IS_SMALLER_OR_EQUAL                              ~10     !0, ~9
         10        BOOL                                             ~8      ~10
         11    > > JMPZ                                                     ~8, ->49
  113    12    >   INIT_METHOD_CALL                                         'jdToYmd'
         13        SEND_VAR_EX                                              !0
         14        DO_FCALL                                      0  $11     
         15        FETCH_LIST_R                                     $12     $11, 0
         16        ASSIGN                                                   !2, $12
         17        FETCH_LIST_R                                     $14     $11, 1
         18        ASSIGN                                                   !3, $14
         19        FETCH_LIST_R                                     $16     $11, 2
         20        ASSIGN                                                   !4, $16
         21        FREE                                                     $11
  116    22        CONCAT                                           ~18     !3, '%2F'
         23        CONCAT                                           ~19     ~18, !4
         24        CONCAT                                           ~20     ~19, '%2F'
         25        CONCAT                                           ~21     ~20, !2
         26        INIT_ARRAY                                       ~22     ~21, 'date'
  117    27        ADD_ARRAY_ELEMENT                                ~22     !3, 'month'
  118    28        ADD_ARRAY_ELEMENT                                ~22     !4, 'day'
  119    29        ADD_ARRAY_ELEMENT                                ~22     !2, 'year'
  120    30        ADD_ARRAY_ELEMENT                                ~22     !1, 'dow'
  121    31        INIT_METHOD_CALL                                         'dayNameAbbreviated'
         32        SEND_VAR_EX                                              !1
         33        DO_FCALL                                      0  $23     
         34        ADD_ARRAY_ELEMENT                                ~22     $23, 'abbrevdayname'
  122    35        INIT_METHOD_CALL                                         'dayName'
         36        SEND_VAR_EX                                              !1
         37        DO_FCALL                                      0  $24     
         38        ADD_ARRAY_ELEMENT                                ~22     $24, 'dayname'
  123    39        INIT_METHOD_CALL                                         'jdMonthNameAbbreviated'
         40        SEND_VAR_EX                                              !0
         41        DO_FCALL                                      0  $25     
         42        ADD_ARRAY_ELEMENT                                ~22     $25, 'abbrevmonth'
  124    43        INIT_METHOD_CALL                                         'jdMonthName'
         44        SEND_VAR_EX                                              !0
         45        DO_FCALL                                      0  $26     
         46        ADD_ARRAY_ELEMENT                                ~22     $26, 'monthname'
         47      > RETURN                                                   ~22
         48*       JMP                                                      ->65
  128    49    >   INIT_ARRAY                                       ~27     '0%2F0%2F0', 'date'
  129    50        ADD_ARRAY_ELEMENT                                ~27     0, 'month'
  130    51        ADD_ARRAY_ELEMENT                                ~27     0, 'day'
  131    52        ADD_ARRAY_ELEMENT                                ~27     0, 'year'
  132    53        ADD_ARRAY_ELEMENT                                ~27     !1, 'dow'
  133    54        INIT_METHOD_CALL                                         'dayNameAbbreviated'
         55        SEND_VAR_EX                                              !1
         56        DO_FCALL                                      0  $28     
         57        ADD_ARRAY_ELEMENT                                ~27     $28, 'abbrevdayname'
  134    58        INIT_METHOD_CALL                                         'dayName'
         59        SEND_VAR_EX                                              !1
         60        DO_FCALL                                      0  $29     
         61        ADD_ARRAY_ELEMENT                                ~27     $29, 'dayname'
  135    62        ADD_ARRAY_ELEMENT                                ~27     '', 'abbrevmonth'
  136    63        ADD_ARRAY_ELEMENT                                ~27     '', 'monthname'
         64      > RETURN                                                   ~27
  139    65*     > RETURN                                                   null

End of function calfromjd

Function phpcalinfo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i9qdO
function name:  phpCalInfo
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  148     0  E >   INIT_METHOD_CALL                                         'monthNames'
          1        DO_FCALL                                      0  $0      
          2        INIT_ARRAY                                       ~1      $0, 'months'
  149     3        INIT_METHOD_CALL                                         'monthNamesAbbreviated'
          4        DO_FCALL                                      0  $2      
          5        ADD_ARRAY_ELEMENT                                ~1      $2, 'abbrevmonths'
  150     6        FETCH_CLASS_CONSTANT                             ~3      'MAX_DAYS_IN_MONTH'
          7        ADD_ARRAY_ELEMENT                                ~1      ~3, 'maxdaysinmonth'
  151     8        FETCH_CLASS_CONSTANT                             ~4      'PHP_CALENDAR_NAME'
          9        ADD_ARRAY_ELEMENT                                ~1      ~4, 'calname'
  152    10        FETCH_CLASS_CONSTANT                             ~5      'PHP_CALENDAR_SYMBOL'
         11        ADD_ARRAY_ELEMENT                                ~1      ~5, 'calsymbol'
         12      > RETURN                                                   ~1
  154    13*     > RETURN                                                   null

End of function phpcalinfo

Function dayofweek:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i9qdO
function name:  dayOfWeek
number of ops:  11
compiled vars:  !0 = $jd, !1 = $dow
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  163     0  E >   RECV                                             !0      
  164     1        ADD                                              ~2      !0, 1
          2        MOD                                              ~3      ~2, 7
          3        ASSIGN                                                   !1, ~3
  165     4        IS_SMALLER                                               !1, 0
          5      > JMPZ                                                     ~5, ->9
  166     6    >   ADD                                              ~6      !1, 7
          7      > RETURN                                                   ~6
          8*       JMP                                                      ->10
  168     9    > > RETURN                                                   !1
  170    10*     > RETURN                                                   null

End of function dayofweek

Function dayname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i9qdO
function name:  dayName
number of ops:  7
compiled vars:  !0 = $dow, !1 = $days
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  179     0  E >   RECV                                             !0      
  180     1        INIT_METHOD_CALL                                         'dayNames'
          2        DO_FCALL                                      0  $2      
          3        ASSIGN                                                   !1, $2
  182     4        FETCH_DIM_R                                      ~4      !1, !0
          5      > RETURN                                                   ~4
  183     6*     > RETURN                                                   null

End of function dayname

Function daynameabbreviated:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i9qdO
function name:  dayNameAbbreviated
number of ops:  7
compiled vars:  !0 = $dow, !1 = $days
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  192     0  E >   RECV                                             !0      
  193     1        INIT_METHOD_CALL                                         'dayNamesAbbreviated'
          2        DO_FCALL                                      0  $2      
          3        ASSIGN                                                   !1, $2
  195     4        FETCH_DIM_R                                      ~4      !1, !0
          5      > RETURN                                                   ~4
  196     6*     > RETURN                                                   null

End of function daynameabbreviated

Function jdmonthname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i9qdO
function name:  jdMonthName
number of ops:  13
compiled vars:  !0 = $jd, !1 = $month, !2 = $months
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  205     0  E >   RECV                                             !0      
  206     1        INIT_METHOD_CALL                                         'jdToYmd'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $3      
          4        FETCH_LIST_R                                     $4      $3, 1
          5        ASSIGN                                                   !1, $4
          6        FREE                                                     $3
  207     7        INIT_METHOD_CALL                                         'monthNames'
          8        DO_FCALL                                      0  $6      
          9        ASSIGN                                                   !2, $6
  209    10        FETCH_DIM_R                                      ~8      !2, !1
         11      > RETURN                                                   ~8
  210    12*     > RETURN                                                   null

End of function jdmonthname

Function jdmonthnameabbreviated:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i9qdO
function name:  jdMonthNameAbbreviated
number of ops:  13
compiled vars:  !0 = $jd, !1 = $month, !2 = $months
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  219     0  E >   RECV                                             !0      
  220     1        INIT_METHOD_CALL                                         'jdToYmd'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $3      
          4        FETCH_LIST_R                                     $4      $3, 1
          5        ASSIGN                                                   !1, $4
          6        FREE                                                     $3
  221     7        INIT_METHOD_CALL                                         'monthNamesAbbreviated'
          8        DO_FCALL                                      0  $6      
          9        ASSIGN                                                   !2, $6
  223    10        FETCH_DIM_R                                      ~8      !2, !1
         11      > RETURN                                                   ~8
  224    12*     > RETURN                                                   null

End of function jdmonthnameabbreviated

Function monthnamesabbreviated:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i9qdO
function name:  monthNamesAbbreviated
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  232     0  E >   INIT_METHOD_CALL                                         'monthNames'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
  233     3*     > RETURN                                                   null

End of function monthnamesabbreviated

End of class Fisharebest\ExtCalendar\Calendar.

Class Fisharebest\ExtCalendar\JulianCalendar:
Function monthnames:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i9qdO
function name:  monthNames
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  284     0  E > > RETURN                                                   <array>
  286     1*     > RETURN                                                   null

End of function monthnames

Function monthnamesabbreviated:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i9qdO
function name:  monthNamesAbbreviated
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  295     0  E > > RETURN                                                   <array>
  297     1*     > RETURN                                                   null

End of function monthnamesabbreviated

Function leapyear:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/i9qdO
function name:  leapYear
number of ops:  8
compiled vars:  !0 = $year
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  306     0  E >   RECV                                             !0      
  307     1        IS_SMALLER                                               !0, 0
          2      > JMPZ                                                     ~1, ->4
  308     3    >   PRE_INC                                                  !0
  311     4    >   MOD                                              ~3      !0, 4
          5        IS_EQUAL                                         ~4      ~3, 0
          6      > RETURN                                                   ~4
  312     7*     > RETURN                                                   null

End of function leapyear

Function jdtoymd:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 39
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
filename:       /in/i9qdO
function name:  jdToYmd
number of ops:  44
compiled vars:  !0 = $jd, !1 = $c, !2 = $d, !3 = $e, !4 = $m, !5 = $day, !6 = $month, !7 = $year
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  321     0  E >   RECV                                             !0      
  322     1        ADD                                              ~8      !0, 32082
          2        ASSIGN                                                   !1, ~8
  323     3        MUL                                              ~10     !1, 4
          4        ADD                                              ~11     ~10, 3
          5        DIV                                              ~12     ~11, 1461
          6        CAST                                          4  ~13     ~12
          7        ASSIGN                                                   !2, ~13
  324     8        MUL                                              ~15     !2, 1461
          9        DIV                                              ~16     ~15, 4
         10        CAST                                          4  ~17     ~16
         11        SUB                                              ~18     !1, ~17
         12        ASSIGN                                                   !3, ~18
  325    13        MUL                                              ~20     !3, 5
         14        ADD                                              ~21     ~20, 2
         15        DIV                                              ~22     ~21, 153
         16        CAST                                          4  ~23     ~22
         17        ASSIGN                                                   !4, ~23
  326    18        MUL                                              ~25     !4, 153
         19        ADD                                              ~26     ~25, 2
         20        DIV                                              ~27     ~26, 5
         21        CAST                                          4  ~28     ~27
         22        SUB                                              ~29     !3, ~28
         23        ADD                                              ~30     ~29, 1
         24        ASSIGN                                                   !5, ~30
  327    25        ADD                                              ~32     !4, 3
         26        DIV                                              ~33     !4, 10
         27        CAST                                          4  ~34     ~33
         28        MUL                                              ~35     ~34, 12
         29        SUB                                              ~36     ~32, ~35
         30        ASSIGN                                                   !6, ~36
  328    31        SUB                                              ~38     !2, 4800
         32        DIV                                              ~39     !4, 10
         33        CAST                                          4  ~40     ~39
         34        ADD                                              ~41     ~38, ~40
         35        ASSIGN                                                   !7, ~41
  329    36        IS_SMALLER                                               !7, 1
         37      > JMPZ                                                     ~43, ->39
  331    38    >   PRE_DEC                                                  !7
  334    39    >   INIT_ARRAY                                       ~45     !7
         40        ADD_ARRAY_ELEMENT                                ~45     !6
         41        ADD_ARRAY_ELEMENT                                ~45     !5
         42      > RETURN                                                   ~45
  335    43*     > RETURN                                                   null

End of function jdtoymd

Function ymdtojd:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/i9qdO
function name:  ymdToJd
number of ops:  30
compiled vars:  !0 = $year, !1 = $month, !2 = $day, !3 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  346     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
  347     3        IS_SMALLER                                               !0, 0
          4      > JMPZ                                                     ~4, ->6
  349     5    >   PRE_INC                                                  !0
  351     6    >   SUB                                              ~6      14, !1
          7        DIV                                              ~7      ~6, 12
          8        CAST                                          4  ~8      ~7
          9        ASSIGN                                                   !3, ~8
  352    10        ADD                                              ~10     !0, 4800
         11        SUB                                              ~11     ~10, !3
         12        ASSIGN                                                   !0, ~11
  353    13        MUL                                              ~13     !3, 12
         14        ADD                                              ~14     !1, ~13
         15        SUB                                              ~15     ~14, 3
         16        ASSIGN                                                   !1, ~15
  355    17        MUL                                              ~17     !1, 153
         18        ADD                                              ~18     ~17, 2
         19        DIV                                              ~19     ~18, 5
         20        CAST                                          4  ~20     ~19
         21        ADD                                              ~21     !2, ~20
         22        MUL                                              ~22     !0, 365
         23        ADD                                              ~23     ~21, ~22
         24        DIV                                              ~24     !0, 4
         25        CAST                                          4  ~25     ~24
         26        ADD                                              ~26     ~23, ~25
         27        SUB                                              ~27     ~26, 32083
         28      > RETURN                                                   ~27
  356    29*     > RETURN                                                   null

End of function ymdtojd

Function daysinmonth:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
2 jumps found. (Code = 47) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
Branch analysis from position: 6
filename:       /in/i9qdO
function name:  daysInMonth
number of ops:  25
compiled vars:  !0 = $year, !1 = $month
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  366     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  367     2        IS_EQUAL                                         ~2      !0, 0
          3      > JMPNZ_EX                                         ~2      ~2, ->6
          4    >   IS_SMALLER                                       ~3      !1, 1
          5        BOOL                                             ~2      ~3
          6    > > JMPNZ_EX                                         ~2      ~2, ->9
          7    >   IS_SMALLER                                       ~4      12, !1
          8        BOOL                                             ~2      ~4
          9    > > JMPZ                                                     ~2, ->17
  368    10    >   INIT_NS_FCALL_BY_NAME                                    'Fisharebest%5CExtCalendar%5Ctrigger_error'
         11        SEND_VAL_EX                                              'invalid+date.'
         12        FETCH_CONSTANT                                   ~5      'Fisharebest%5CExtCalendar%5CE_USER_WARNING'
         13        SEND_VAL_EX                                              ~5
         14        DO_FCALL                                      0  $6      
         15      > RETURN                                                   $6
         16*       JMP                                                      ->24
  370 

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.29 ms | 1428 KiB | 15 Q