3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $intlDateFormatter = new IntlDateFormatter( 'en_GB', IntlDateFormatter::MEDIUM, IntlDateFormatter::NONE, 'Europe/Rome', IntlDateFormatter::GREGORIAN, 'yyyy-MM-dd' ); $timezone = $intlDateFormatter->getTimeZone(); var_dump($timezone->getDisplayName()); $intlDateFormatter->setLenient(false); $date = '1990-03-24'; $res = $intlDateFormatter->parse($date); echo "$date - $res\n"; // 1990-03-24 - 638229600 $date = '1990-03-25'; //$intlDateFormatter->setLenient(true); $res = $intlDateFormatter->parse($date, $pos); var_dump($res); var_dump($pos); var_dump($intlDateFormatter->getErrorCode()); var_dump($intlDateFormatter->getErrorMessage()); echo "$date - $res\n"; // 1990-03-25 - $date = '1990-03-26'; $res = $intlDateFormatter->parse($date); echo "$date - $res\n"; // 1990-03-26 - 638398800
based on u0rtJ
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/4Bc0G
function name:  (null)
number of ops:  71
compiled vars:  !0 = $intlDateFormatter, !1 = $timezone, !2 = $date, !3 = $res, !4 = $pos
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NEW                                              $5      :-6
   4     1        SEND_VAL_EX                                              'en_GB'
   5     2        FETCH_CONSTANT                                   ~6      'IntlDateFormatter', 'MEDIUM'
         3        SEND_VAL_EX                                              ~6
   6     4        FETCH_CONSTANT                                   ~7      'IntlDateFormatter', 'NONE'
         5        SEND_VAL_EX                                              ~7
   7     6        SEND_VAL_EX                                              'Europe%2FRome'
   8     7        FETCH_CONSTANT                                   ~8      'IntlDateFormatter', 'GREGORIAN'
         8        SEND_VAL_EX                                              ~8
   9     9        SEND_VAL_EX                                              'yyyy-MM-dd'
        10        DO_FCALL                                      0          
        11        ASSIGN                                                   !0, $5
  11    12        INIT_METHOD_CALL                                         !0, 'getTimeZone'
        13        DO_FCALL                                      0  $11     
        14        ASSIGN                                                   !1, $11
  12    15        INIT_FCALL                                               'var_dump'
        16        INIT_METHOD_CALL                                         !1, 'getDisplayName'
        17        DO_FCALL                                      0  $13     
        18        SEND_VAR                                                 $13
        19        DO_ICALL                                                 
  13    20        INIT_METHOD_CALL                                         !0, 'setLenient'
        21        SEND_VAL_EX                                              <false>
        22        DO_FCALL                                      0          
  15    23        ASSIGN                                                   !2, '1990-03-24'
  16    24        INIT_METHOD_CALL                                         !0, 'parse'
        25        SEND_VAR_EX                                              !2
        26        DO_FCALL                                      0  $17     
        27        ASSIGN                                                   !3, $17
  18    28        ROPE_INIT                                     4  ~20     !2
        29        ROPE_ADD                                      1  ~20     ~20, '+-+'
        30        ROPE_ADD                                      2  ~20     ~20, !3
        31        ROPE_END                                      3  ~19     ~20, '%0A'
        32        ECHO                                                     ~19
  20    33        ASSIGN                                                   !2, '1990-03-25'
  22    34        INIT_METHOD_CALL                                         !0, 'parse'
        35        SEND_VAR_EX                                              !2
        36        SEND_VAR_EX                                              !4
        37        DO_FCALL                                      0  $23     
        38        ASSIGN                                                   !3, $23
  23    39        INIT_FCALL                                               'var_dump'
        40        SEND_VAR                                                 !3
        41        DO_ICALL                                                 
  24    42        INIT_FCALL                                               'var_dump'
        43        SEND_VAR                                                 !4
        44        DO_ICALL                                                 
  25    45        INIT_FCALL                                               'var_dump'
        46        INIT_METHOD_CALL                                         !0, 'getErrorCode'
        47        DO_FCALL                                      0  $27     
        48        SEND_VAR                                                 $27
        49        DO_ICALL                                                 
  26    50        INIT_FCALL                                               'var_dump'
        51        INIT_METHOD_CALL                                         !0, 'getErrorMessage'
        52        DO_FCALL                                      0  $29     
        53        SEND_VAR                                                 $29
        54        DO_ICALL                                                 
  27    55        ROPE_INIT                                     4  ~32     !2
        56        ROPE_ADD                                      1  ~32     ~32, '+-+'
        57        ROPE_ADD                                      2  ~32     ~32, !3
        58        ROPE_END                                      3  ~31     ~32, '%0A'
        59        ECHO                                                     ~31
  29    60        ASSIGN                                                   !2, '1990-03-26'
  30    61        INIT_METHOD_CALL                                         !0, 'parse'
        62        SEND_VAR_EX                                              !2
        63        DO_FCALL                                      0  $35     
        64        ASSIGN                                                   !3, $35
  31    65        ROPE_INIT                                     4  ~38     !2
        66        ROPE_ADD                                      1  ~38     ~38, '+-+'
        67        ROPE_ADD                                      2  ~38     ~38, !3
        68        ROPE_END                                      3  ~37     ~38, '%0A'
        69        ECHO                                                     ~37
        70      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0