3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = '28/5/1972'; $formats = [ 'dd/MM/yyyy', 'd/m/Y', ]; foreach ($formats as $format) { var_dump($format); $intlDateFormatter = new IntlDateFormatter( 'en_US', IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/Los_Angeles', IntlDateFormatter::GREGORIAN, $format ); $intlDateFormatter->setLenient(false); $intlDateFormatter->parse($date); var_dump($intlDateFormatter->getErrorMessage()); //$intlDateFormatter->setLenient(true); $intlDateFormatter->parse($date); var_dump($intlDateFormatter->getErrorMessage()); } $fmt = new IntlDateFormatter( 'en_US', IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/Los_Angeles', IntlDateFormatter::GREGORIAN, 'dd/MM/yyyy' ); echo 'lenient of the formatter is : '; if ($fmt->isLenient()) { echo 'TRUE'; } else { echo 'FALSE'; } $fmt->parse('35/13/1971'); echo "\n Trying to do parse('35/13/1971').\nResult is : " . $fmt->parse('35/13/1971');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 39
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 39
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 58
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 58
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
filename:       /in/emYiX
function name:  (null)
number of ops:  68
compiled vars:  !0 = $date, !1 = $formats, !2 = $format, !3 = $intlDateFormatter, !4 = $fmt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '28%2F5%2F1972'
    4     1        ASSIGN                                                   !1, <array>
    9     2      > FE_RESET_R                                       $7      !1, ->39
          3    > > FE_FETCH_R                                               $7, !2, ->39
   10     4    >   INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !2
          6        DO_ICALL                                                 
   11     7        NEW                                              $9      'IntlDateFormatter'
   12     8        SEND_VAL_EX                                              'en_US'
   13     9        FETCH_CLASS_CONSTANT                             ~10     'IntlDateFormatter', 'FULL'
         10        SEND_VAL_EX                                              ~10
   14    11        FETCH_CLASS_CONSTANT                             ~11     'IntlDateFormatter', 'FULL'
         12        SEND_VAL_EX                                              ~11
   15    13        SEND_VAL_EX                                              'America%2FLos_Angeles'
   16    14        FETCH_CLASS_CONSTANT                             ~12     'IntlDateFormatter', 'GREGORIAN'
         15        SEND_VAL_EX                                              ~12
   12    16        SEND_VAR_EX                                              !2
         17        DO_FCALL                                      0          
   11    18        ASSIGN                                                   !3, $9
   21    19        INIT_METHOD_CALL                                         !3, 'setLenient'
         20        SEND_VAL_EX                                              <false>
         21        DO_FCALL                                      0          
   22    22        INIT_METHOD_CALL                                         !3, 'parse'
         23        SEND_VAR_EX                                              !0
         24        DO_FCALL                                      0          
   23    25        INIT_FCALL                                               'var_dump'
         26        INIT_METHOD_CALL                                         !3, 'getErrorMessage'
         27        DO_FCALL                                      0  $17     
         28        SEND_VAR                                                 $17
         29        DO_ICALL                                                 
   26    30        INIT_METHOD_CALL                                         !3, 'parse'
         31        SEND_VAR_EX                                              !0
         32        DO_FCALL                                      0          
   27    33        INIT_FCALL                                               'var_dump'
         34        INIT_METHOD_CALL                                         !3, 'getErrorMessage'
         35        DO_FCALL                                      0  $20     
         36        SEND_VAR                                                 $20
         37        DO_ICALL                                                 
    9    38      > JMP                                                      ->3
         39    >   FE_FREE                                                  $7
   30    40        NEW                                              $22     'IntlDateFormatter'
   31    41        SEND_VAL_EX                                              'en_US'
   32    42        FETCH_CLASS_CONSTANT                             ~23     'IntlDateFormatter', 'FULL'
         43        SEND_VAL_EX                                              ~23
   33    44        FETCH_CLASS_CONSTANT                             ~24     'IntlDateFormatter', 'FULL'
         45        SEND_VAL_EX                                              ~24
   34    46        SEND_VAL_EX                                              'America%2FLos_Angeles'
   35    47        FETCH_CLASS_CONSTANT                             ~25     'IntlDateFormatter', 'GREGORIAN'
         48        SEND_VAL_EX                                              ~25
   36    49        SEND_VAL_EX                                              'dd%2FMM%2Fyyyy'
         50        DO_FCALL                                      0          
   30    51        ASSIGN                                                   !4, $22
   38    52        ECHO                                                     'lenient+of+the+formatter+is+%3A+'
   39    53        INIT_METHOD_CALL                                         !4, 'isLenient'
         54        DO_FCALL                                      0  $28     
         55      > JMPZ                                                     $28, ->58
   40    56    >   ECHO                                                     'TRUE'
         57      > JMP                                                      ->59
   42    58    >   ECHO                                                     'FALSE'
   44    59    >   INIT_METHOD_CALL                                         !4, 'parse'
         60        SEND_VAL_EX                                              '35%2F13%2F1971'
         61        DO_FCALL                                      0          
   45    62        INIT_METHOD_CALL                                         !4, 'parse'
         63        SEND_VAL_EX                                              '35%2F13%2F1971'
         64        DO_FCALL                                      0  $30     
         65        CONCAT                                           ~31     '%0A+Trying+to+do+parse%28%2735%2F13%2F1971%27%29.%0AResult+is+%3A+', $30
         66        ECHO                                                     ~31
         67      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.86 ms | 1400 KiB | 15 Q