3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tz = new DateTimeZone('America/Chicago'); $formatter = new \IntlDateFormatter('en_US', IntlDateFormatter::SHORT, IntlDateFormatter::SHORT, $tz, null, 'YYYY-MM-dd'); $date = new DateTime('2018-12-31', $tz); echo $formatter->format($date); // expected: 2018-12-31 // actual: 2019-12-31
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/krQR4
function name:  (null)
number of ops:  25
compiled vars:  !0 = $tz, !1 = $formatter, !2 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'DateTimeZone'
          1        SEND_VAL_EX                                              'America%2FChicago'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    4     4        NEW                                              $6      'IntlDateFormatter'
          5        SEND_VAL_EX                                              'en_US'
          6        FETCH_CLASS_CONSTANT                             ~7      'IntlDateFormatter', 'SHORT'
          7        SEND_VAL_EX                                              ~7
          8        FETCH_CLASS_CONSTANT                             ~8      'IntlDateFormatter', 'SHORT'
          9        SEND_VAL_EX                                              ~8
         10        SEND_VAR_EX                                              !0
         11        SEND_VAL_EX                                              null
         12        SEND_VAL_EX                                              'YYYY-MM-dd'
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !1, $6
    5    15        NEW                                              $11     'DateTime'
         16        SEND_VAL_EX                                              '2018-12-31'
         17        SEND_VAR_EX                                              !0
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !2, $11
    6    20        INIT_METHOD_CALL                                         !1, 'format'
         21        SEND_VAR_EX                                              !2
         22        DO_FCALL                                      0  $14     
         23        ECHO                                                     $14
    9    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.76 ms | 1394 KiB | 13 Q