3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tz = new DateTimeZone('America/Chicago'); $formatter = new \IntlDateFormatter('en_US', IntlDateFormatter::SHORT, null, $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/tDplh
function name:  (null)
number of ops:  24
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        SEND_VAL_EX                                              null
          9        SEND_VAR_EX                                              !0
         10        SEND_VAL_EX                                              null
         11        SEND_VAL_EX                                              'YYYY-MM-dd'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !1, $6
    5    14        NEW                                              $10     'DateTime'
         15        SEND_VAL_EX                                              '2018-12-31'
         16        SEND_VAR_EX                                              !0
         17        DO_FCALL                                      0          
         18        ASSIGN                                                   !2, $10
    6    19        INIT_METHOD_CALL                                         !1, 'format'
         20        SEND_VAR_EX                                              !2
         21        DO_FCALL                                      0  $13     
         22        ECHO                                                     $13
    9    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
126.33 ms | 1398 KiB | 13 Q