3v4l.org

run code in 300+ PHP versions simultaneously
<?php class DateTimeExtended extends DateTime { public function __get($name) { switch ($name) { case 'year': return (int)$this->format('Y'); case 'month': return (int)$this->format('n'); case 'day': return (int)$this->format('j'); case 'hour': return (int)$this->format('G'); case 'minute': return (int)$this->format('i'); case 'second': return (int)$this->format('s'); case 'dayOfWeek': return (int)$this->format('w'); case 'dayOfYear': return (int)$this->format('z'); case 'weekOfYear': return (int)$this->format('W'); case 'daysInMonth': return (int)$this->format('t'); case 'timestamp': return (int)$this->format('U'); default: throw new InvalidArgumentException(sprintf('Unknown property "%s".', $name)); } } public static function createFromFormat($format, $time, $tz = null) { if ($tz) { $date = parent::createFromFormat($format, $time, $tz); } else { $date = parent::createFromFormat($format, $time); } $errors = static::getLastErrors(); if ($errors['warning_count'] !== 0 || $errors['error_count'] !== 0) { throw new InvalidArgumentException(sprintf('Unable to parse date "%s" by pattern "%s".', $time, $format)); } if (!$date instanceof self) { return new static($date->format('Y-m-d H:i:s'), $date->getTimeZone()); } return $date; } public function format($format) { $format = preg_replace_callback('/(?:f|[Мм]есяца?|[Дд]еньнед(?:ели)?)/u', array($this, 'replaceFormatCallback'), $format); return parent::format($format); } public function replaceFormatCallback(array $matches) { switch ($matches[0]) { case 'f': return mb_strtolower(en_get_month_name($this->month)); case 'Месяц': return ru_get_month_name($this->month); case 'Месяца': return ru_get_month_name($this->month, 2); case 'месяц': return mb_strtolower(ru_get_month_name($this->month)); case 'месяца': return mb_strtolower(ru_get_month_name($this->month, 2)); case 'Деньнедели': return ru_get_weekday_name($this->dayOfWeek); case 'Деньнед': return ru_get_weekday_name($this->dayOfWeek, true); case 'деньнедели': return mb_strtolower(ru_get_weekday_name($this->dayOfWeek)); case 'деньнед': return mb_strtolower(ru_get_weekday_name($this->dayOfWeek, true)); } return $matches[0]; } public static function convert($from, $to, $value) { return static::createFromFormat($from, $value)->format($to); } public static function check($format, $value) { try { static::createFromFormat($format, $value); } catch (InvalidArgumentException $e) { return false; } return true; } } $t = microtime(true); for ($i = 0; $i < 2000; $i++) { DateTimeExtended::convert('Y-m-d', 'd.m.Y H:i:s', '2000-01-01'); } echo 'DateTimeExtended:'.(microtime(true) - $t)."\n"; //---------------------------------------------------------------------------------------------------- function int_pad($number, $count = 2) { return str_pad((int)$number, $count, '0', STR_PAD_LEFT); } function Date_parseDate($format, $str) { $patterns['Y'] = array('(\d{4})', 'year'); $patterns['y'] = array('(\d{2})'); $patterns['m'] = array('(\d{2})', 'month'); $patterns['n'] = array('(\d{1,2})', 'month'); $patterns['d'] = array('(\d{2})', 'day'); $patterns['j'] = array('(\d{1,2})', 'day'); $patterns['H'] = array('(\d{2})', 'hour'); $patterns['h'] = array('(\d{1,2})', 'hour'); $patterns['i'] = array('(\d{1,2})', 'minute'); $patterns['M'] = array('(\d{2})', 'minute'); $patterns['s'] = array('(\d{1,2})', 'second'); $patterns['U'] = array('(-?\d+)'); $parameters = array(); $out_types = array(); for ($i = 0; $i < mb_strlen($format); $i++) { $char = mb_substr($format, $i, 1); if (isset($patterns[$char])) { $out_types[] = $char; $parameters[] = $patterns[$char][0]; } else { $parameters[] = $char; } } if (!preg_match('/^'.implode($parameters).'$/u', $str, $out)) { throw new RuntimeException(sprintf('Не удалось распарсить дату "%s" по шаблону "%s".', $str, $format)); } // FIX /* $date['year'] = (int)date('Y'); $date['month'] = (int)date('n'); $date['day'] = (int)date('j'); $date['hour'] = (int)date('h'); $date['minute'] = (int)date('i'); $date['second'] = (int)date('s');*/ $date['year'] = 1970; $date['month'] = 1; $date['day'] = 1; $date['hour'] = 0; $date['minute'] = 0; $date['second'] = 0; for ($i = 0; $i < count($out_types); $i++) { $pattern = $patterns[$out_types[$i]]; if (isset($pattern[1])) { $date[$pattern[1]] = (int)$out[$i + 1]; } else { if ($out_types[$i] === 'U') { $standard_date = getdate($out[$i + 1]); $date['year'] = $standard_date['year']; $date['month'] = $standard_date['mon']; $date['day'] = $standard_date['mday']; $date['hour'] = $standard_date['hours']; $date['minute'] = $standard_date['minutes']; $date['second'] = $standard_date['seconds']; } if ($out_types[$i] === 'y') { $date['year'] = $out[$i + 1] + ($out[$i + 1] < 30 ? 2000 : 1900); } } } return $date; } function Date_createDate($format, $date) { $patterns['Y'] = int_pad($date['year'], 4); $patterns['y'] = int_pad($date['year'] - (int)($date['year'] / 100) * 100); $patterns['m'] = int_pad($date['month']); $patterns['n'] = $date['month']; $patterns['d'] = int_pad($date['day']); $patterns['j'] = $date['day']; $patterns['H'] = int_pad($date['hour']); $patterns['h'] = $date['hour']; $patterns['G'] = int_pad($date['hour']); $patterns['g'] = $date['hour']; $patterns['i'] = int_pad($date['minute']); $patterns['M'] = int_pad($date['minute']); $patterns['s'] = int_pad($date['second']); $patterns['U'] = mktime($date['hour'], $date['minute'], $date['second'], $date['month'], $date['day'], $date['year']); $parameters = array(); for ($i = 0; $i < mb_strlen($format); $i++) { $char = mb_substr($format, $i, 1); $parameters[] = isset($patterns[$char]) ? $patterns[$char] : $char; } $text = implode($parameters); $replace['/Месяца/eu'] = 'ru_get_month_name('.(int)$date['month'].', 2)'; $replace['/Месяц/eu'] = 'ru_get_month_name('.(int)$date['month'].')'; $replace['/месяца/eu'] = 'mb_strtolower(ru_get_month_name('.(int)$date['month'].', 2))'; $replace['/месяц/eu'] = 'mb_strtolower(ru_get_month_name('.(int)$date['month'].'))'; $replace['/F/eu'] = 'en_get_month_name('.(int)$date['month'].')'; $replace['/f/eu'] = 'mb_strtolower(en_get_month_name('.(int)$date['month'].'))'; if ($patterns['U']) { $replace['/Деньнедели/eu'] = 'ru_get_weekday_name(date("w", '.(int)$patterns['U'].'))'; $replace['/Деньнед/eu'] = 'ru_get_weekday_name(date("w", '.(int)$patterns['U'].'), true)'; $replace['/деньнедели/eu'] = 'mb_strtolower(ru_get_weekday_name(date("w", '.(int)$patterns['U'].')))'; $replace['/деньнед/eu'] = 'mb_strtolower(ru_get_weekday_name(date("w", '.(int)$patterns['U'].'), true))'; } return preg_replace(array_keys($replace), $replace, $text); } function Date_checkDate($format, $str) { $patterns['Y'] = array('(\d{4})', 'year'); $patterns['y'] = array('(\d{2})'); $patterns['m'] = array('(\d{2})', 'month'); $patterns['n'] = array('(\d{1,2})', 'month'); $patterns['d'] = array('(\d{2})', 'day'); $patterns['j'] = array('(\d{1,2})', 'day'); $patterns['H'] = array('(\d{2})', 'hour'); $patterns['h'] = array('(\d{1,2})', 'hour'); $patterns['i'] = array('(\d{1,2})', 'minute'); $patterns['M'] = array('(\d{2})', 'minute'); $patterns['s'] = array('(\d{1,2})', 'second'); $patterns['U'] = array('(-?\d+)'); $parameters = array(); $out_types = array(); for ($i = 0; $i < mb_strlen($format); $i++) { $char = mb_substr($format, $i, 1); if (isset($patterns[$char])) { $out_types[] = $char; $parameters[] = $patterns[$char][0]; } else { $parameters[] = $char; } } return (bool)preg_match('/^'.implode($parameters).'$/u', $str, $out); } function Date_convert($format_from, $format_to, $str) { $date = Date_parseDate($format_from, $str); return Date_createDate($format_to, $date); } $t = microtime(true); for ($i = 0; $i < 2000; $i++) { Date_convert('Y-m-d', 'd.m.Y H:i:s', '2000-01-01'); } echo 'DateConvert: '.(microtime(true) - $t)."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 6
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 27
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 27
Branch analysis from position: 35
Branch analysis from position: 27
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 6
Branch analysis from position: 14
Branch analysis from position: 6
filename:       /in/AGQNX
function name:  (null)
number of ops:  43
compiled vars:  !0 = $t, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  101     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
  102     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->12
  103     6    >   INIT_STATIC_METHOD_CALL                                  'DateTimeExtended', 'convert'
          7        SEND_VAL                                                 'Y-m-d'
          8        SEND_VAL                                                 'd.m.Y+H%3Ai%3As'
          9        SEND_VAL                                                 '2000-01-01'
         10        DO_FCALL                                      0          
  102    11        PRE_INC                                                  !1
         12    >   IS_SMALLER                                               !1, 2000
         13      > JMPNZ                                                    ~7, ->6
  105    14    >   INIT_FCALL                                               'microtime'
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $8      
         17        SUB                                              ~9      $8, !0
         18        CONCAT                                           ~10     'DateTimeExtended%3A', ~9
         19        CONCAT                                           ~11     ~10, '%0A'
         20        ECHO                                                     ~11
  256    21        INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $12     
         24        ASSIGN                                                   !0, $12
  257    25        ASSIGN                                                   !1, 0
         26      > JMP                                                      ->33
  258    27    >   INIT_FCALL                                               'date_convert'
         28        SEND_VAL                                                 'Y-m-d'
         29        SEND_VAL                                                 'd.m.Y+H%3Ai%3As'
         30        SEND_VAL                                                 '2000-01-01'
         31        DO_FCALL                                      0          
  257    32        PRE_INC                                                  !1
         33    >   IS_SMALLER                                               !1, 2000
         34      > JMPNZ                                                    ~17, ->27
  260    35    >   INIT_FCALL                                               'microtime'
         36        SEND_VAL                                                 <true>
         37        DO_ICALL                                         $18     
         38        SUB                                              ~19     $18, !0
         39        CONCAT                                           ~20     'DateConvert%3A+', ~19
         40        CONCAT                                           ~21     ~20, '%0A'
         41        ECHO                                                     ~21
         42      > RETURN                                                   1

Function int_pad:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AGQNX
function name:  int_pad
number of ops:  11
compiled vars:  !0 = $number, !1 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  109     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      2
  110     2        INIT_FCALL                                               'str_pad'
          3        CAST                                          4  ~2      !0
          4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !1
          6        SEND_VAL                                                 '0'
          7        SEND_VAL                                                 0
          8        DO_ICALL                                         $3      
          9      > RETURN                                                   $3
  111    10*     > RETURN                                                   null

End of function int_pad

Function date_parsedate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 30
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 74
Branch analysis from position: 65
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 74
1 jumps found. (Code = 42) Position 1 = 143
Branch analysis from position: 143
2 jumps found. (Code = 44) Position 1 = 146, Position 2 = 88
Branch analysis from position: 146
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 88
2 jumps found. (Code = 43) Position 1 = 93, Position 2 = 100
Branch analysis from position: 93
1 jumps found. (Code = 42) Position 1 = 142
Branch analysis from position: 142
2 jumps found. (Code = 44) Position 1 = 146, Position 2 = 88
Branch analysis from position: 146
Branch analysis from position: 88
Branch analysis from position: 100
2 jumps found. (Code = 43) Position 1 = 103, Position 2 = 127
Branch analysis from position: 103
2 jumps found. (Code = 43) Position 1 = 130, Position 2 = 142
Branch analysis from position: 130
2 jumps found. (Code = 43) Position 1 = 136, Position 2 = 138
Branch analysis from position: 136
1 jumps found. (Code = 42) Position 1 = 139
Branch analysis from position: 139
2 jumps found. (Code = 44) Position 1 = 146, Position 2 = 88
Branch analysis from position: 146
Branch analysis from position: 88
Branch analysis from position: 138
2 jumps found. (Code = 44) Position 1 = 146, Position 2 = 88
Branch analysis from position: 146
Branch analysis from position: 88
Branch analysis from position: 142
Branch analysis from position: 127
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 45
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 30
Branch analysis from position: 53
Branch analysis from position: 30
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 30
Branch analysis from position: 53
Branch analysis from position: 30
filename:       /in/AGQNX
function name:  Date_parseDate
number of ops:  148
compiled vars:  !0 = $format, !1 = $str, !2 = $patterns, !3 = $parameters, !4 = $out_types, !5 = $i, !6 = $char, !7 = $out, !8 = $date, !9 = $pattern, !10 = $standard_date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  113     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  114     2        ASSIGN_DIM                                               !2, 'Y'
          3        OP_DATA                                                  <array>
  115     4        ASSIGN_DIM                                               !2, 'y'
          5        OP_DATA                                                  <array>
  116     6        ASSIGN_DIM                                               !2, 'm'
          7        OP_DATA                                                  <array>
  117     8        ASSIGN_DIM                                               !2, 'n'
          9        OP_DATA                                                  <array>
  118    10        ASSIGN_DIM                                               !2, 'd'
         11        OP_DATA                                                  <array>
  119    12        ASSIGN_DIM                                               !2, 'j'
         13        OP_DATA                                                  <array>
  120    14        ASSIGN_DIM                                               !2, 'H'
         15        OP_DATA                                                  <array>
  121    16        ASSIGN_DIM                                               !2, 'h'
         17        OP_DATA                                                  <array>
  122    18        ASSIGN_DIM                                               !2, 'i'
         19        OP_DATA                                                  <array>
  123    20        ASSIGN_DIM                                               !2, 'M'
         21        OP_DATA                                                  <array>
  124    22        ASSIGN_DIM                                               !2, 's'
         23        OP_DATA                                                  <array>
  125    24        ASSIGN_DIM                                               !2, 'U'
         25        OP_DATA                                                  <array>
  127    26        ASSIGN                                                   !3, <array>
  128    27        ASSIGN                                                   !4, <array>
  129    28        ASSIGN                                                   !5, 0
         29      > JMP                                                      ->48
  130    30    >   INIT_FCALL                                               'mb_substr'
         31        SEND_VAR                                                 !0
         32        SEND_VAR                                                 !5
         33        SEND_VAL                                                 1
         34        DO_ICALL                                         $26     
         35        ASSIGN                                                   !6, $26
  131    36        ISSET_ISEMPTY_DIM_OBJ                         0          !2, !6
         37      > JMPZ                                                     ~28, ->45
  132    38    >   ASSIGN_DIM                                               !4
         39        OP_DATA                                                  !6
  133    40        FETCH_DIM_R                                      ~31     !2, !6
         41        FETCH_DIM_R                                      ~32     ~31, 0
         42        ASSIGN_DIM                                               !3
         43        OP_DATA                                                  ~32
         44      > JMP                                                      ->47
  135    45    >   ASSIGN_DIM                                               !3
         46        OP_DATA                                                  !6
  129    47    >   PRE_INC                                                  !5
         48    >   INIT_FCALL                                               'mb_strlen'
         49        SEND_VAR                                                 !0
         50        DO_ICALL                                         $35     
         51        IS_SMALLER                                               !5, $35
         52      > JMPNZ                                                    ~36, ->30
  139    53    >   INIT_FCALL                                               'preg_match'
         54        INIT_FCALL                                               'implode'
         55        SEND_VAR                                                 !3
         56        DO_ICALL                                         $37     
         57        CONCAT                                           ~38     '%2F%5E', $37
         58        CONCAT                                           ~39     ~38, '%24%2Fu'
         59        SEND_VAL                                                 ~39
         60        SEND_VAR                                                 !1
         61        SEND_REF                                                 !7
         62        DO_ICALL                                         $40     
         63        BOOL_NOT                                         ~41     $40
         64      > JMPZ                                                     ~41, ->74
  140    65    >   NEW                                              $42     'RuntimeException'
         66        INIT_FCALL                                               'sprintf'
         67        SEND_VAL                                                 '%D0%9D%D0%B5+%D1%83%D0%B4%D0%B0%D0%BB%D0%BE%D1%81%D1%8C+%D1%80%D0%B0%D1%81%D0%BF%D0%B0%D1%80%D1%81%D0%B8%D1%82%D1%8C+%D0%B4%D0%B0%D1%82%D1%83+%22%25s%22+%D0%BF%D0%BE+%D1%88%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD%D1%83+%22%25s%22.'
         68        SEND_VAR                                                 !1
         69        SEND_VAR                                                 !0
         70        DO_ICALL                                         $43     
         71        SEND_VAR_NO_REF_EX                                       $43
         72        DO_FCALL                                      0          
         73      > THROW                                         0          $42
  151    74    >   ASSIGN_DIM                                               !8, 'year'
         75        OP_DATA                                                  1970
  152    76        ASSIGN_DIM                                               !8, 'month'
         77        OP_DATA                                                  1
  153    78        ASSIGN_DIM                                               !8, 'day'
         79        OP_DATA                                                  1
  154    80        ASSIGN_DIM                                               !8, 'hour'
         81        OP_DATA                                                  0
  155    82        ASSIGN_DIM                                               !8, 'minute'
         83        OP_DATA                                                  0
  156    84        ASSIGN_DIM                                               !8, 'second'
         85        OP_DATA                                                  0
  158    86        ASSIGN                                                   !5, 0
         87      > JMP                                                      ->143
  159    88    >   FETCH_DIM_R                                      ~52     !4, !5
         89        FETCH_DIM_R                                      ~53     !2, ~52
         90        ASSIGN                                                   !9, ~53
  160    91        ISSET_ISEMPTY_DIM_OBJ                         0          !9, 1
         92      > JMPZ                                                     ~55, ->100
  161    93    >   FETCH_DIM_R                                      ~56     !9, 1
         94        ADD                                              ~58     !5, 1
         95        FETCH_DIM_R                                      ~59     !7, ~58
         96        CAST                                          4  ~60     ~59
         97        ASSIGN_DIM                                               !8, ~56
         98        OP_DATA                                                  ~60
         99      > JMP                                                      ->142
  163   100    >   FETCH_DIM_R                                      ~61     !4, !5
        101        IS_IDENTICAL                                             ~61, 'U'
        102      > JMPZ                                                     ~62, ->127
  164   103    >   INIT_FCALL                                               'getdate'
        104        ADD                                              ~63     !5, 1
        105        FETCH_DIM_R                                      ~64     !7, ~63
        106        SEND_VAL                                                 ~64
        107        DO_ICALL                                         $65     
        108        ASSIGN                                                   !10, $65
  165   109        FETCH_DIM_R                                      ~68     !10, 'year'
        110        ASSIGN_DIM                                               !8, 'year'
        111        OP_DATA                                                  ~68
  166   112        FETCH_DIM_R                                      ~70     !10, 'mon'
        113        ASSIGN_DIM                                               !8, 'month'
        114        OP_DATA                                                  ~70
  167   115        FETCH_DIM_R                                      ~72     !10, 'mday'
        116        ASSIGN_DIM                                               !8, 'day'
        117        OP_DATA                                                  ~72
  168   118        FETCH_DIM_R                                      ~74     !10, 'hours'
        119        ASSIGN_DIM                                               !8, 'hour'
        120        OP_DATA                                                  ~74
  169   121        FETCH_DIM_R                                      ~76     !10, 'minutes'
        122        ASSIGN_DIM                                               !8, 'minute'
        123        OP_DATA                                                  ~76
  170   124        FETCH_DIM_R                                      ~78     !10, 'seconds'
        125        ASSIGN_DIM                                               !8, 'second'
        126        OP_DATA                                                  ~78
  172   127    >   FETCH_DIM_R                                      ~79     !4, !5
        128        IS_IDENTICAL                                             ~79, 'y'
        129      > JMPZ                                                     ~80, ->142
  173   130    >   ADD                                              ~82     !5, 1
        131        FETCH_DIM_R                                      ~83     !7, ~82
        132        ADD                                              ~84     !5, 1
        133        FETCH_DIM_R                                      ~85     !7, ~84
        134        IS_SMALLER                                               ~85, 30
        135      > JMPZ                                                     ~86, ->138
        136    >   QM_ASSIGN                                        ~87     2000
        137      > JMP                                                      ->139
        138    >   QM_ASSIGN                                        ~87     1900
        139    >   ADD                                              ~88     ~83, ~87
        140        ASSIGN_DIM                                               !8, 'year'
        141        OP_DATA                                                  ~88
  158   142    >   PRE_INC                                                  !5
        143    >   COUNT                                            ~90     !4
        144        IS_SMALLER                                               !5, ~90
        145      > JMPNZ                                                    ~91, ->88
  177   146    > > RETURN                                                   !8
  178   147*     > RETURN                                                   null

End of function date_parsedate

Function date_createdate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 108
Branch analysis from position: 108
2 jumps found. (Code = 44) Position 1 = 113, Position 2 = 93
Branch analysis from position: 113
2 jumps found. (Code = 43) Position 1 = 155, Position 2 = 179
Branch analysis from position: 155
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 179
Branch analysis from position: 93
2 jumps found. (Code = 43) Position 1 = 101, Position 2 = 104
Branch analysis from position: 101
1 jumps found. (Code = 42) Position 1 = 105
Branch analysis from position: 105
2 jumps found. (Code = 44) Position 1 = 113, Position 2 = 93
Branch analysis from position: 113
Branch analysis from position: 93
Branch analysis from position: 104
2 jumps found. (Code = 44) Position 1 = 113, Position 2 = 93
Branch analysis from position: 113
Branch analysis from position: 93
filename:       /in/AGQNX
function name:  Date_createDate
number of ops:  189
compiled vars:  !0 = $format, !1 = $date, !2 = $patterns, !3 = $parameters, !4 = $i, !5 = $char, !6 = $text, !7 = $replace
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  180     0  E >   RECV                                             !0      
          1        RECV                                             !1      
  181     2        INIT_FCALL                                               'int_pad'
          3        FETCH_DIM_R                                      ~9      !1, 'year'
          4        SEND_VAL                                                 ~9
          5        SEND_VAL                                                 4
          6        DO_FCALL                                      0  $10     
          7        ASSIGN_DIM                                               !2, 'Y'
          8        OP_DATA                                                  $10
  182     9        INIT_FCALL                                               'int_pad'
         10        FETCH_DIM_R                                      ~12     !1, 'year'
         11        FETCH_DIM_R                                      ~13     !1, 'year'
         12        DIV                                              ~14     ~13, 100
         13        CAST                                          4  ~15     ~14
         14        MUL                                              ~16     ~15, 100
         15        SUB                                              ~17     ~12, ~16
         16        SEND_VAL                                                 ~17
         17        DO_FCALL                                      0  $18     
         18        ASSIGN_DIM                                               !2, 'y'
         19        OP_DATA                                                  $18
  183    20        INIT_FCALL                                               'int_pad'
         21        FETCH_DIM_R                                      ~20     !1, 'month'
         22        SEND_VAL                                                 ~20
         23        DO_FCALL                                      0  $21     
         24        ASSIGN_DIM                                               !2, 'm'
         25        OP_DATA                                                  $21
  184    26        FETCH_DIM_R                                      ~23     !1, 'month'
         27        ASSIGN_DIM                                               !2, 'n'
         28        OP_DATA                                                  ~23
  185    29        INIT_FCALL                                               'int_pad'
         30        FETCH_DIM_R                                      ~25     !1, 'day'
         31        SEND_VAL                                                 ~25
         32        DO_FCALL                                      0  $26     
         33        ASSIGN_DIM                                               !2, 'd'
         34        OP_DATA                                                  $26
  186    35        FETCH_DIM_R                                      ~28     !1, 'day'
         36        ASSIGN_DIM                                               !2, 'j'
         37        OP_DATA                                                  ~28
  187    38        INIT_FCALL                                               'int_pad'
         39        FETCH_DIM_R                                      ~30     !1, 'hour'
         40        SEND_VAL                                                 ~30
         41        DO_FCALL                                      0  $31     
         42        ASSIGN_DIM                                               !2, 'H'
         43        OP_DATA                                                  $31
  188    44        FETCH_DIM_R                                      ~33     !1, 'hour'
         45        ASSIGN_DIM                                               !2, 'h'
         46        OP_DATA                                                  ~33
  189    47        INIT_FCALL                                               'int_pad'
         48        FETCH_DIM_R                                      ~35     !1, 'hour'
         49        SEND_VAL                                                 ~35
         50        DO_FCALL                                      0  $36     
         51        ASSIGN_DIM                                               !2, 'G'
         52        OP_DATA                                                  $36
  190    53        FETCH_DIM_R                                      ~38     !1, 'hour'
         54        ASSIGN_DIM                                               !2, 'g'
         55        OP_DATA                                                  ~38
  191    56        INIT_FCALL                                               'int_pad'
         57        FETCH_DIM_R                                      ~40     !1, 'minute'
         58        SEND_VAL                                                 ~40
         59        DO_FCALL                                      0  $41     
         60        ASSIGN_DIM                                               !2, 'i'
         61        OP_DATA                                                  $41
  192    62        INIT_FCALL                                               'int_pad'
         63        FETCH_DIM_R                                      ~43     !1, 'minute'
         64        SEND_VAL                                                 ~43
         65        DO_FCALL                                      0  $44     
         66        ASSIGN_DIM                                               !2, 'M'
         67        OP_DATA                                                  $44
  193    68        INIT_FCALL                                               'int_pad'
         69        FETCH_DIM_R                                      ~46     !1, 'second'
         70        SEND_VAL                                                 ~46
         71        DO_FCALL                                      0  $47     
         72        ASSIGN_DIM                                               !2, 's'
         73        OP_DATA                                                  $47
  194    74        INIT_FCALL                                               'mktime'
         75        FETCH_DIM_R                                      ~49     !1, 'hour'
         76        SEND_VAL                                                 ~49
         77        FETCH_DIM_R                                      ~50     !1, 'minute'
         78        SEND_VAL                                                 ~50
         79        FETCH_DIM_R                                      ~51     !1, 'second'
         80        SEND_VAL                                                 ~51
         81        FETCH_DIM_R                                      ~52     !1, 'month'
         82        SEND_VAL                                                 ~52
         83        FETCH_DIM_R                                      ~53     !1, 'day'
         84        SEND_VAL                                                 ~53
         85        FETCH_DIM_R                                      ~54     !1, 'year'
         86        SEND_VAL                                                 ~54
         87        DO_ICALL                                         $55     
         88        ASSIGN_DIM                                               !2, 'U'
         89        OP_DATA                                                  $55
  196    90        ASSIGN                                                   !3, <array>
  197    91        ASSIGN                                                   !4, 0
         92      > JMP                                                      ->108
  198    93    >   INIT_FCALL                                               'mb_substr'
         94        SEND_VAR                                                 !0
         95        SEND_VAR                                                 !4
         96        SEND_VAL                                                 1
         97        DO_ICALL                                         $58     
         98        ASSIGN                                                   !5, $58
  199    99        ISSET_ISEMPTY_DIM_OBJ                         0          !2, !5
        100      > JMPZ                                                     ~61, ->104
        101    >   FETCH_DIM_R                                      ~62     !2, !5
        102        QM_ASSIGN                                        ~63     ~62
        103      > JMP                                                      ->105
        104    >   QM_ASSIGN                                        ~63     !5
        105    >   ASSIGN_DIM                                               !3
        106        OP_DATA                                                  ~63
  197   107        PRE_INC                                                  !4
        108    >   INIT_FCALL                                               'mb_strlen'
        109        SEND_VAR                                                 !0
        110        DO_ICALL                                         $65     
        111        IS_SMALLER                                               !4, $65
        112      > JMPNZ                                                    ~66, ->93
  201   113    >   INIT_FCALL                                               'implode'
        114        SEND_VAR                                                 !3
        115        DO_ICALL                                         $67     
        116        ASSIGN                                                   !6, $67
  203   117        FETCH_DIM_R                                      ~70     !1, 'month'
        118        CAST                                          4  ~71     ~70
        119        CONCAT                                           ~72     'ru_get_month_name%28', ~71
        120        CONCAT                                           ~73     ~72, '%2C+2%29'
        121        ASSIGN_DIM                                               !7, '%2F%D0%9C%D0%B5%D1%81%D1%8F%D1%86%D0%B0%2Feu'
        122        OP_DATA                                                  ~73
  204   123        FETCH_DIM_R                                      ~75    

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.03 ms | 1430 KiB | 41 Q