3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * IntlDateTime is an extended version of php 5 DateTime class with integrated * IntlDateFormatter functionality which adds support for multible calendars * and locales provided by ICU project. (needs php >= 5.3.0 with intl extension) * However, this class is not compatible with DateTime class because it uses ICU * pattern syntax for formatting and parsing date strings. * (@link http://userguide.icu-project.org/formatparse/datetime) * * @copyright Copyright 2010, Ali Farhadi (http://farhadi.ir/) * @license GNU General Public License 3.0 (http://www.gnu.org/licenses/gpl.html) */ class IntlDateTime extends DateTime { /** * @var string The current locale in use */ protected $locale; /** * @var string The current calendar in use */ protected $calendar; /** * Creates a new instance of IntlDateTime * * @param mixed $time Unix timestamp or strtotime() compatible string or another DateTime object * @param mixed $timezone DateTimeZone object or timezone identifier as full name (e.g. Asia/Tehran) or abbreviation (e.g. IRDT). * @param string $calendar any calendar supported by ICU (e.g. gregorian, persian, islamic, ...) * @param string $locale any locale supported by ICU * @param string $pattern the date pattern in which $time is formatted. * @return IntlDateTime */ public function __construct($time = null, $timezone = null, $calendar = 'gregorian', $locale = 'en_US', $pattern = null) { if (!isset($timezone)) $timezone = new DateTimeZone(date_default_timezone_get()); elseif (!is_a($timezone, 'DateTimeZone')) $timezone = new DateTimeZone($timezone); parent::__construct(null, $timezone); $this->setLocale($locale); $this->setCalendar($calendar); if (isset($time)) $this->set($time, null, $pattern); } /** * Returns an instance of IntlDateFormatter with specified options. * * @param array $options * @return IntlDateFormatter */ protected function getFormatter($options = array()) { $locale = empty($options['locale']) ? $this->locale : $options['locale']; $calendar = empty($options['calendar']) ? $this->calendar : $options['calendar']; $timezone = empty($options['timezone']) ? $this->getTimezone() : $options['timezone']; if (is_a($timezone, 'DateTimeZone')) $timezone = $timezone->getName(); $pattern = empty($options['pattern']) ? null : $options['pattern']; return new IntlDateFormatter($locale . '@calendar=' . $calendar, IntlDateFormatter::FULL, IntlDateFormatter::FULL, $timezone, $calendar == 'gregorian' ? IntlDateFormatter::GREGORIAN : IntlDateFormatter::TRADITIONAL, $pattern); } /** * Replaces localized digits in $str with latin digits. * * @param string $str * @return string Latinized string */ protected function latinizeDigits($str) { $result = ''; $num = new NumberFormatter($this->locale, NumberFormatter::DECIMAL); preg_match_all('/.[\x80-\xBF]*/', $str, $matches); foreach ($matches[0] as $char) { $pos = 0; $parsedChar = $num->parse($char, NumberFormatter::TYPE_INT32, $pos); $result .= $pos ? $parsedChar : $char; } return $result; } /** * Tries to guess the date pattern in which $time is formatted. * * @param string $time The date string * @return string Detected ICU pattern on success, FALSE otherwise. */ protected function guessPattern($time) { $time = $this->latinizeDigits(trim($time)); $shortDateRegex = '(\d{2,4})(-|\\\\|/)\d{1,2}\2\d{1,2}'; $longDateRegex = '([^\d]*\s)?\d{1,2}(-| )[^-\s\d]+\4(\d{2,4})'; $timeRegex = '\d{1,2}:\d{1,2}(:\d{1,2})?(\s.*)?'; if (preg_match("@^(?:(?:$shortDateRegex)|(?:$longDateRegex))(\s+$timeRegex)?$@", $time, $match)) { if (!empty($match[1])) { $separator = $match[2]; $pattern = strlen($match[1]) == 2 ? 'yy' : 'yyyy'; $pattern .= $separator . 'MM' . $separator . 'dd'; } else { $separator = $match[4]; $pattern = 'dd' . $separator . 'LLL' . $separator; $pattern .= strlen($match[5]) == 2 ? 'yy' : 'yyyy'; if (!empty($match[3])) $pattern = (preg_match('/,\s+$/', $match[3]) ? 'E, ' : 'E ') . $pattern; } if (!empty($match[6])) { $pattern .= !empty($match[8]) ? ' hh:mm' : ' HH:mm'; if (!empty($match[7])) $pattern .= ':ss'; if (!empty($match[8])) $pattern .= ' a'; } return $pattern; } return false; } /** * Sets the locale used by the object. * * @param string $locale * @return IntlDateTime The modified DateTime. */ public function setLocale($locale) { $this->locale = $locale; return $this; } /** * Gets the current locale used by the object. * * @return string */ public function getLocale() { return $this->locale; } /** * Sets the calendar used by the object. * * @param string $calendar * @return IntlDateTime The modified DateTime. */ public function setCalendar($calendar) { $this->calendar = strtolower($calendar); return $this; } /** * Gets the current calendar used by the object. * * @return string */ public function getCalendar() { return $this->calendar; } /** * Overrides the getTimestamp method to support timestamps out of the integer range. * * @return float Unix timestamp representing the date. */ public function getTimestamp() { return floatval(parent::format('U')); } /** * Overrides the setTimestamp method to support timestamps out of the integer range. * * @param float $unixtimestamp Unix timestamp representing the date. * @return IntlDateTime the modified DateTime. */ public function setTimestamp($unixtimestamp) { $diff = $unixtimestamp - $this->getTimestamp(); $days = floor($diff / 86400); $seconds = $diff - $days * 86400; $timezone = $this->getTimezone(); $this->setTimezone('UTC'); parent::modify("$days days $seconds seconds"); $this->setTimezone($timezone); return $this; } /** * Alters object's internal timestamp with a string acceptable by strtotime() or a Unix timestamp or a DateTime object. * * @param mixed $time Unix timestamp or strtotime() compatible string or another DateTime object * @param mixed $timezone DateTimeZone object or timezone identifier as full name (e.g. Asia/Tehran) or abbreviation (e.g. IRDT). * @param string $pattern the date pattern in which $time is formatted. * @return IntlDateTime The modified DateTime. */ public function set($time, $timezone = null, $pattern = null) { if (is_a($time, 'DateTime')) { $time = $time->format('U'); } elseif (!is_numeric($time) || $pattern) { if (!$pattern) { $pattern = $this->guessPattern($time); } if (!$pattern && preg_match('/((?:[+-]?\d+)|next|last|previous)\s*(year|month)s?/i', $time)) { if (isset($timezone)) { $tempTimezone = $this->getTimezone(); $this->setTimezone($timezone); } $this->setTimestamp(time()); $this->modify($time); if (isset($timezone)) { $this->setTimezone($tempTimezone); } return $this; } $timezone = empty($timezone) ? $this->getTimezone() : $timezone; if (is_a($timezone, 'DateTimeZone')) $timezone = $timezone->getName(); $defaultTimezone = @date_default_timezone_get(); date_default_timezone_set($timezone); if ($pattern) { $time = $this->getFormatter(array('timezone' => 'GMT', 'pattern' => $pattern))->parse($time); $time -= date('Z', $time); } else { $time = strtotime($time); } date_default_timezone_set($defaultTimezone); } $this->setTimestamp($time); return $this; } /** * Resets the current date of the object. * * @param integer $year * @param integer $month * @param integer $day * @return IntlDateTime The modified DateTime. */ public function setDate($year, $month, $day) { $this->set("$year/$month/$day ".$this->format('HH:mm:ss'), null, 'yyyy/MM/dd HH:mm:ss'); return $this; } /** * Sets the timezone for the object. * * @param mixed $timezone DateTimeZone object or timezone identifier as full name (e.g. Asia/Tehran) or abbreviation (e.g. IRDT). * @return IntlDateTime The modified DateTime. */ public function setTimezone($timezone) { if (!is_a($timezone, 'DateTimeZone')) $timezone = new DateTimeZone($timezone); parent::setTimezone($timezone); return $this; } /** * Internally used by modify method to calculate calendar-aware modifications * * @param array $matches * @return string An empty string */ protected function modifyCallback($matches) { if (!empty($matches[1])) { parent::modify($matches[1]); } list($y, $m, $d) = explode('-', $this->format('y-M-d')); $change = strtolower($matches[2]); $unit = strtolower($matches[3]); switch ($change) { case "next": $change = 1; break; case "last": case "previous": $change = -1; break; } switch ($unit) { case "month": $m += $change; if ($m > 12) { $y += floor($m/12); $m = $m % 12; } elseif ($m < 1) { $y += ceil($m/12) - 1; $m = $m % 12 + 12; } break; case "year": $y += $change; break; } $this->setDate($y, $m, $d); return ''; } /** * Alter the timestamp by incrementing or decrementing in a format accepted by strtotime(). * * @param string $modify a string in a relative format accepted by strtotime(). * @return IntlDateTime The modified DateTime. */ public function modify($modify) { $modify = $this->latinizeDigits(trim($modify)); $modify = preg_replace_callback('/(.*?)((?:[+-]?\d+)|next|last|previous)\s*(year|month)s?/i', array($this, 'modifyCallback'), $modify); if ($modify) parent::modify($modify); return $this; } /** * Returns date formatted according to given pattern. * * @param string $pattern Date pattern in ICU syntax (@link http://userguide.icu-project.org/formatparse/datetime) * @param mixed $timezone DateTimeZone object or timezone identifier as full name (e.g. Asia/Tehran) or abbreviation (e.g. IRDT). * @return string Formatted date on success or FALSE on failure. */ public function format($pattern, $timezone = null) { if (isset($timezone)) { $tempTimezone = $this->getTimezone(); $this->setTimezone($timezone); } // Timezones DST data in ICU are not as accurate as PHP. // So we get timezone offset from php and pass it to ICU. $result = $this->getFormatter(array( 'timezone' => 'GMT' . (parent::format('Z') ? parent::format('P') : ''), 'pattern' => $pattern ))->format($this->getTimestamp()); if (isset($timezone)) { $this->setTimezone($tempTimezone); } return $result; } /** * Preserve original DateTime::format functionality * * @param string $format Format accepted by date(). * @param mixed $timezone DateTimeZone object or timezone identifier as full name (e.g. Asia/Tehran) or abbreviation (e.g. IRDT). * @return string Formatted date on success or FALSE on failure. */ public function classicFormat($format, $timezone = null) { if (isset($timezone)) { $tempTimezone = $this->getTimezone(); $this->setTimezone($timezone); } $result = parent::format($format); if (isset($timezone)) { $this->setTimezone($tempTimezone); } return $result; } } $date = new IntlDateTime('now', 'Asia/Tehran', 'gregorian'); echo $date->getTimestamp();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/41h0f
function name:  (null)
number of ops:  10
compiled vars:  !0 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  369     0  E >   NEW                                              $1      'IntlDateTime'
          1        SEND_VAL_EX                                              'now'
          2        SEND_VAL_EX                                              'Asia%2FTehran'
          3        SEND_VAL_EX                                              'gregorian'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
  370     6        INIT_METHOD_CALL                                         !0, 'getTimestamp'
          7        DO_FCALL                                      0  $4      
          8        ECHO                                                     $4
          9      > RETURN                                                   1

Class IntlDateTime:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 42
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 25
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 42
Branch analysis from position: 37
Branch analysis from position: 42
Branch analysis from position: 25
filename:       /in/41h0f
function name:  __construct
number of ops:  43
compiled vars:  !0 = $time, !1 = $timezone, !2 = $calendar, !3 = $locale, !4 = $pattern
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      null
          2        RECV_INIT                                        !2      'gregorian'
          3        RECV_INIT                                        !3      'en_US'
          4        RECV_INIT                                        !4      null
   36     5        ISSET_ISEMPTY_CV                                 ~5      !1
          6        BOOL_NOT                                         ~6      ~5
          7      > JMPZ                                                     ~6, ->15
          8    >   NEW                                              $7      'DateTimeZone'
          9        INIT_FCALL                                               'date_default_timezone_get'
         10        DO_ICALL                                         $8      
         11        SEND_VAR_NO_REF_EX                                       $8
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !1, $7
         14      > JMP                                                      ->25
   37    15    >   INIT_FCALL                                               'is_a'
         16        SEND_VAR                                                 !1
         17        SEND_VAL                                                 'DateTimeZone'
         18        DO_ICALL                                         $11     
         19        BOOL_NOT                                         ~12     $11
         20      > JMPZ                                                     ~12, ->25
         21    >   NEW                                              $13     'DateTimeZone'
         22        SEND_VAR_EX                                              !1
         23        DO_FCALL                                      0          
         24        ASSIGN                                                   !1, $13
   39    25    >   INIT_STATIC_METHOD_CALL                                  
         26        SEND_VAL_EX                                              null
         27        SEND_VAR_EX                                              !1
         28        DO_FCALL                                      0          
   40    29        INIT_METHOD_CALL                                         'setLocale'
         30        SEND_VAR_EX                                              !3
         31        DO_FCALL                                      0          
   41    32        INIT_METHOD_CALL                                         'setCalendar'
         33        SEND_VAR_EX                                              !2
         34        DO_FCALL                                      0          
   42    35        ISSET_ISEMPTY_CV                                         !0
         36      > JMPZ                                                     ~19, ->42
         37    >   INIT_METHOD_CALL                                         'set'
         38        SEND_VAR_EX                                              !0
         39        SEND_VAL_EX                                              null
         40        SEND_VAR_EX                                              !4
         41        DO_FCALL                                      0          
   43    42    > > RETURN                                                   null

End of function __construct

Function getformatter:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 34
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 38
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 55
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 55
Branch analysis from position: 52
Branch analysis from position: 55
Branch analysis from position: 34
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 34
Branch analysis from position: 31
Branch analysis from position: 34
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
Branch analysis from position: 23
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
Branch analysis from position: 14
filename:       /in/41h0f
function name:  getFormatter
number of ops:  62
compiled vars:  !0 = $options, !1 = $locale, !2 = $calendar, !3 = $timezone, !4 = $pattern
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   51     0  E >   RECV_INIT                                        !0      <array>
   52     1        ISSET_ISEMPTY_DIM_OBJ                         1          !0, 'locale'
          2      > JMPZ                                                     ~5, ->6
          3    >   FETCH_OBJ_R                                      ~6      'locale'
          4        QM_ASSIGN                                        ~7      ~6
          5      > JMP                                                      ->8
          6    >   FETCH_DIM_R                                      ~8      !0, 'locale'
          7        QM_ASSIGN                                        ~7      ~8
          8    >   ASSIGN                                                   !1, ~7
   53     9        ISSET_ISEMPTY_DIM_OBJ                         1          !0, 'calendar'
         10      > JMPZ                                                     ~10, ->14
         11    >   FETCH_OBJ_R                                      ~11     'calendar'
         12        QM_ASSIGN                                        ~12     ~11
         13      > JMP                                                      ->16
         14    >   FETCH_DIM_R                                      ~13     !0, 'calendar'
         15        QM_ASSIGN                                        ~12     ~13
         16    >   ASSIGN                                                   !2, ~12
   54    17        ISSET_ISEMPTY_DIM_OBJ                         1          !0, 'timezone'
         18      > JMPZ                                                     ~15, ->23
         19    >   INIT_METHOD_CALL                                         'getTimezone'
         20        DO_FCALL                                      0  $16     
         21        QM_ASSIGN                                        ~17     $16
         22      > JMP                                                      ->25
         23    >   FETCH_DIM_R                                      ~18     !0, 'timezone'
         24        QM_ASSIGN                                        ~17     ~18
         25    >   ASSIGN                                                   !3, ~17
   55    26        INIT_FCALL                                               'is_a'
         27        SEND_VAR                                                 !3
         28        SEND_VAL                                                 'DateTimeZone'
         29        DO_ICALL                                         $20     
         30      > JMPZ                                                     $20, ->34
         31    >   INIT_METHOD_CALL                                         !3, 'getName'
         32        DO_FCALL                                      0  $21     
         33        ASSIGN                                                   !3, $21
   56    34    >   ISSET_ISEMPTY_DIM_OBJ                         1          !0, 'pattern'
         35      > JMPZ                                                     ~23, ->38
         36    >   QM_ASSIGN                                        ~24     null
         37      > JMP                                                      ->40
         38    >   FETCH_DIM_R                                      ~25     !0, 'pattern'
         39        QM_ASSIGN                                        ~24     ~25
         40    >   ASSIGN                                                   !4, ~24
   57    41        NEW                                              $27     'IntlDateFormatter'
         42        CONCAT                                           ~28     !1, '%40calendar%3D'
         43        CONCAT                                           ~29     ~28, !2
         44        SEND_VAL_EX                                              ~29
   58    45        FETCH_CLASS_CONSTANT                             ~30     'IntlDateFormatter', 'FULL'
         46        SEND_VAL_EX                                              ~30
         47        FETCH_CLASS_CONSTANT                             ~31     'IntlDateFormatter', 'FULL'
         48        SEND_VAL_EX                                              ~31
   57    49        SEND_VAR_EX                                              !3
   59    50        IS_EQUAL                                                 !2, 'gregorian'
         51      > JMPZ                                                     ~32, ->55
         52    >   FETCH_CLASS_CONSTANT                             ~33     'IntlDateFormatter', 'GREGORIAN'
         53        QM_ASSIGN                                        ~34     ~33
         54      > JMP                                                      ->57
         55    >   FETCH_CLASS_CONSTANT                             ~35     'IntlDateFormatter', 'TRADITIONAL'
         56        QM_ASSIGN                                        ~34     ~35
         57    >   SEND_VAL_EX                                              ~34
   57    58        SEND_VAR_EX                                              !4
         59        DO_FCALL                                      0          
         60      > RETURN                                                   $27
   60    61*     > RETURN                                                   null

End of function getformatter

Function latinizedigits:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 32
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 32
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/41h0f
function name:  latinizeDigits
number of ops:  35
compiled vars:  !0 = $str, !1 = $result, !2 = $num, !3 = $matches, !4 = $char, !5 = $pos, !6 = $parsedChar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   68     0  E >   RECV                                             !0      
   69     1        ASSIGN                                                   !1, ''
   70     2        NEW                                              $8      'NumberFormatter'
          3        CHECK_FUNC_ARG                                           
          4        FETCH_OBJ_FUNC_ARG                               $9      'locale'
          5        SEND_FUNC_ARG                                            $9
          6        FETCH_CLASS_CONSTANT                             ~10     'NumberFormatter', 'DECIMAL'
          7        SEND_VAL_EX                                              ~10
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !2, $8
   71    10        INIT_FCALL                                               'preg_match_all'
         11        SEND_VAL                                                 '%2F.%5B%5Cx80-%5CxBF%5D%2A%2F'
         12        SEND_VAR                                                 !0
         13        SEND_REF                                                 !3
         14        DO_ICALL                                                 
   72    15        FETCH_DIM_R                                      ~14     !3, 0
         16      > FE_RESET_R                                       $15     ~14, ->32
         17    > > FE_FETCH_R                                               $15, !4, ->32
   73    18    >   ASSIGN                                                   !5, 0
   74    19        INIT_METHOD_CALL                                         !2, 'parse'
         20        SEND_VAR_EX                                              !4
         21        FETCH_CLASS_CONSTANT                             ~17     'NumberFormatter', 'TYPE_INT32'
         22        SEND_VAL_EX                                              ~17
         23        SEND_VAR_EX                                              !5
         24        DO_FCALL                                      0  $18     
         25        ASSIGN                                                   !6, $18
   75    26      > JMPZ                                                     !5, ->29
         27    >   QM_ASSIGN                                        ~20     !6
         28      > JMP                                                      ->30
         29    >   QM_ASSIGN                                        ~20     !4
         30    >   ASSIGN_OP                                     8          !1, ~20
   72    31      > JMP                                                      ->17
         32    >   FE_FREE                                                  $15
   77    33      > RETURN                                                   !1
   78    34*     > RETURN                                                   null

End of function latinizedigits

Function guesspattern:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 89
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 42
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 35
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 70
Branch analysis from position: 70
2 jumps found. (Code = 43) Position 1 = 73, Position 2 = 88
Branch analysis from position: 73
2 jumps found. (Code = 43) Position 1 = 76, Position 2 = 78
Branch analysis from position: 76
1 jumps found. (Code = 42) Position 1 = 79
Branch analysis from position: 79
2 jumps found. (Code = 43) Position 1 = 83, Position 2 = 84
Branch analysis from position: 83
2 jumps found. (Code = 43) Position 1 = 87, Position 2 = 88
Branch analysis from position: 87
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 88
Branch analysis from position: 84
Branch analysis from position: 78
2 jumps found. (Code = 43) Position 1 = 83, Position 2 = 84
Branch analysis from position: 83
Branch analysis from position: 84
Branch analysis from position: 88
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 70
Branch analysis from position: 70
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 54
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
2 jumps found. (Code = 43) Position 1 = 59, Position 2 = 70
Branch analysis from position: 59
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 67
Branch analysis from position: 65
1 jumps found. (Code = 42) Position 1 = 68
Branch analysis from position: 68
2 jumps found. (Code = 43) Position 1 = 73, Position 2 = 88
Branch analysis from position: 73
Branch analysis from position: 88
Branch analysis from position: 67
2 jumps found. (Code = 43) Position 1 = 73, Position 2 = 88
Branch analysis from position: 73
Branch analysis from position: 88
Branch analysis from position: 70
Branch analysis from position: 54
2 jumps found. (Code = 43) Position 1 = 59, Position 2 = 70
Branch analysis from position: 59
Branch analysis from position: 70
Branch analysis from position: 89
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/41h0f
function name:  guessPattern
number of ops:  91
compiled vars:  !0 = $time, !1 = $shortDateRegex, !2 = $longDateRegex, !3 = $timeRegex, !4 = $match, !5 = $separator, !6 = $pattern
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   86     0  E >   RECV                                             !0      
   87     1        INIT_METHOD_CALL                                         'latinizeDigits'
          2        INIT_FCALL                                               'trim'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $7      
          5        SEND_VAR_NO_REF_EX                                       $7
          6        DO_FCALL                                      0  $8      
          7        ASSIGN                                                   !0, $8
   89     8        ASSIGN                                                   !1, '%28%5Cd%7B2%2C4%7D%29%28-%7C%5C%5C%7C%2F%29%5Cd%7B1%2C2%7D%5C2%5Cd%7B1%2C2%7D'
   90     9        ASSIGN                                                   !2, '%28%5B%5E%5Cd%5D%2A%5Cs%29%3F%5Cd%7B1%2C2%7D%28-%7C+%29%5B%5E-%5Cs%5Cd%5D%2B%5C4%28%5Cd%7B2%2C4%7D%29'
   91    10        ASSIGN                                                   !3, '%5Cd%7B1%2C2%7D%3A%5Cd%7B1%2C2%7D%28%3A%5Cd%7B1%2C2%7D%29%3F%28%5Cs.%2A%29%3F'
   93    11        INIT_FCALL                                               'preg_match'
         12        ROPE_INIT                                     7  ~14     '%40%5E%28%3F%3A%28%3F%3A'
         13        ROPE_ADD                                      1  ~14     ~14, !1
         14        ROPE_ADD                                      2  ~14     ~14, '%29%7C%28%3F%3A'
         15        ROPE_ADD                                      3  ~14     ~14, !2
         16        ROPE_ADD                                      4  ~14     ~14, '%29%29%28%5Cs%2B'
         17        ROPE_ADD                                      5  ~14     ~14, !3
         18        ROPE_END                                      6  ~13     ~14, '%29%3F%24%40'
         19        SEND_VAL                                                 ~13
         20        SEND_VAR                                                 !0
         21        SEND_REF                                                 !4
         22        DO_ICALL                                         $18     
         23      > JMPZ                                                     $18, ->89
   94    24    >   ISSET_ISEMPTY_DIM_OBJ                         1  ~19     !4, 1
         25        BOOL_NOT                                         ~20     ~19
         26      > JMPZ                                                     ~20, ->42
   95    27    >   FETCH_DIM_R                                      ~21     !4, 2
         28        ASSIGN                                                   !5, ~21
   96    29        FETCH_DIM_R                                      ~23     !4, 1
         30        STRLEN                                           ~24     ~23
         31        IS_EQUAL                                                 ~24, 2
         32      > JMPZ                                                     ~25, ->35
         33    >   QM_ASSIGN                                        ~26     'yy'
         34      > JMP                                                      ->36
         35    >   QM_ASSIGN                                        ~26     'yyyy'
         36    >   ASSIGN                                                   !6, ~26
   97    37        CONCAT                                           ~28     !5, 'MM'
         38        CONCAT                                           ~29     ~28, !5
         39        CONCAT                                           ~30     ~29, 'dd'
         40        ASSIGN_OP                                     8          !6, ~30
         41      > JMP                                                      ->70
   99    42    >   FETCH_DIM_R                                      ~32     !4, 4
         43        ASSIGN                                                   !5, ~32
  100    44        CONCAT                                           ~34     'dd', !5
         45        CONCAT                                           ~35     ~34, 'LLL'
         46        CONCAT                                           ~36     ~35, !5
         47        ASSIGN                                                   !6, ~36
  101    48        FETCH_DIM_R                                      ~38     !4, 5
         49        STRLEN                                           ~39     ~38
         50        IS_EQUAL                                                 ~39, 2
         51      > JMPZ                                                     ~40, ->54
         52    >   QM_ASSIGN                                        ~41     'yy'
         53      > JMP                                                      ->55
         54    >   QM_ASSIGN                                        ~41     'yyyy'
         55    >   ASSIGN_OP                                     8          !6, ~41
  102    56        ISSET_ISEMPTY_DIM_OBJ                         1  ~43     !4, 3
         57        BOOL_NOT                                         ~44     ~43
         58      > JMPZ                                                     ~44, ->70
         59    >   INIT_FCALL                                               'preg_match'
         60        SEND_VAL                                                 '%2F%2C%5Cs%2B%24%2F'
         61        FETCH_DIM_R                                      ~45     !4, 3
         62        SEND_VAL                                                 ~45
         63        DO_ICALL                                         $46     
         64      > JMPZ                                                     $46, ->67
         65    >   QM_ASSIGN                                        ~47     'E%2C+'
         66      > JMP                                                      ->68
         67    >   QM_ASSIGN                                        ~47     'E+'
         68    >   CONCAT                                           ~48     ~47, !6
         69        ASSIGN                                                   !6, ~48
  104    70    >   ISSET_ISEMPTY_DIM_OBJ                         1  ~50     !4, 6
         71        BOOL_NOT                                         ~51     ~50
         72      > JMPZ                                                     ~51, ->88
  105    73    >   ISSET_ISEMPTY_DIM_OBJ                         1  ~52     !4, 8
         74        BOOL_NOT                                         ~53     ~52
         75      > JMPZ                                                     ~53, ->78
         76    >   QM_ASSIGN                                        ~54     '+hh%3Amm'
         77      > JMP                                                      ->79
         78    >   QM_ASSIGN                                        ~54     '+HH%3Amm'
         79    >   ASSIGN_OP                                     8          !6, ~54
  106    80        ISSET_ISEMPTY_DIM_OBJ                         1  ~56     !4, 7
         81        BOOL_NOT                                         ~57     ~56
         82      > JMPZ                                                     ~57, ->84
         83    >   ASSIGN_OP                                     8          !6, '%3Ass'
  107    84    >   ISSET_ISEMPTY_DIM_OBJ                         1  ~59     !4, 8
         85        BOOL_NOT                                         ~60     ~59
         86      > JMPZ                                                     ~60, ->88
         87    >   ASSIGN_OP                                     8          !6, '+a'
  109    88    > > RETURN                                                   !6
  112    89    > > RETURN                                                   <false>
  113    90*     > RETURN                                                   null

End of function guesspattern

Function setlocale:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/41h0f
function name:  setLocale
number of ops:  6
compiled vars:  !0 = $locale
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  121     0  E >   RECV                                             !0      
  122     1        ASSIGN_OBJ                                               'locale'
          2        OP_DATA                                                  !0
  123     3        FETCH_THIS                                       ~2      
          4      > RETURN                                                   ~2
  124     5*     > RETURN                                                   null

End of function setlocale

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

End of function getlocale

Function setcalendar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/41h0f
function name:  setCalendar
number of ops:  9
compiled vars:  !0 = $calendar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  141     0  E >   RECV                                             !0      
  142     1        INIT_FCALL                                               'strtolower'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ASSIGN_OBJ                                               'calendar'
          5        OP_DATA                                                  $2
  143     6        FETCH_THIS                                       ~3      
          7      > RETURN                                                   ~3
  144     8*     > RETURN                                                   null

End of function setcalendar

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

End of function getcalendar

Function gettimestamp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/41h0f
function name:  getTimestamp
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  161     0  E >   INIT_STATIC_METHOD_CALL                                  'format'
          1        SEND_VAL_EX                                              'U'
          2        DO_FCALL                                      0  $0      
          3        CAST                                          5  ~1      $0
          4      > RETURN                                                   ~1
  162     5*     > RETURN                                                   null

End of function gettimestamp

Function settimestamp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/41h0f
function name:  setTimestamp
number of ops:  32
compiled vars:  !0 = $unixtimestamp, !1 = $diff, !2 = $days, !3 = $seconds, !4 = $timezone
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  170     0  E >   RECV                     

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.72 ms | 1444 KiB | 25 Q