3v4l.org

run code in 300+ PHP versions simultaneously
<?php $timezones = [ 'LA (USA)' => 'America/Los_Angeles', 'New York (USA)' => 'America/New_York', 'Paris (FR)' => 'Europe/Paris', 'Brisbane (Aus)' => 'Australia/Brisbane', ]; $locales = [ 'American' => 'en-US', 'Australian' => 'en-AU', 'British' =>'en-UK', 'Canadian' => 'en-CA', 'French Canadian' => 'fr-CA', 'French' => 'fr-FR', 'Japanese' => 'ja-JP', ]; $absoluteDate = new DateTimeImmutable('2024-12-06T03:02:01.123456Z'); foreach ($timezones as $place => $tzName) { echo "\n\n7 people in {$place}, each looking at their computer to find the time and date:"; foreach ($locales as $nationality => $locale) { $fullFormatter = new IntlDateFormatter( $locale, IntlDateFormatter::FULL, IntlDateFormatter::FULL, new DateTimeZone($tzName) ); $shortFormatter = new IntlDateFormatter( $locale, IntlDateFormatter::SHORT, IntlDateFormatter::SHORT, new DateTimeZone($tzName) ); $shortDateOnlyFormatter = new IntlDateFormatter( $locale, IntlDateFormatter::SHORT, IntlDateFormatter::NONE, new DateTimeZone($tzName) ); echo "\n The {$nationality} one sees: - Full: {$fullFormatter->format($absoluteDate)} - Short: {$shortFormatter->format($absoluteDate)} - Short date: {$shortDateOnlyFormatter->format($absoluteDate)}"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 73
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 73
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 71
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 71
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 71
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 71
Branch analysis from position: 73
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 73
filename:       /in/Jbv5q
function name:  (null)
number of ops:  75
compiled vars:  !0 = $timezones, !1 = $locales, !2 = $absoluteDate, !3 = $tzName, !4 = $place, !5 = $locale, !6 = $nationality, !7 = $fullFormatter, !8 = $shortFormatter, !9 = $shortDateOnlyFormatter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, <array>
   20     2        NEW                                              $12     'DateTimeImmutable'
          3        SEND_VAL_EX                                              '2024-12-06T03%3A02%3A01.123456Z'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $12
   23     6      > FE_RESET_R                                       $15     !0, ->73
          7    > > FE_FETCH_R                                       ~16     $15, !3, ->73
          8    >   ASSIGN                                                   !4, ~16
   24     9        ROPE_INIT                                     3  ~19     '%0A%0A7+people+in+'
         10        ROPE_ADD                                      1  ~19     ~19, !4
         11        ROPE_END                                      2  ~18     ~19, '%2C+each+looking+at+their+computer+to+find+the+time+and+date%3A'
         12        ECHO                                                     ~18
   26    13      > FE_RESET_R                                       $21     !1, ->71
         14    > > FE_FETCH_R                                       ~22     $21, !5, ->71
         15    >   ASSIGN                                                   !6, ~22
   27    16        NEW                                              $24     'IntlDateFormatter'
   28    17        SEND_VAR_EX                                              !5
   29    18        FETCH_CLASS_CONSTANT                             ~25     'IntlDateFormatter', 'FULL'
         19        SEND_VAL_EX                                              ~25
   30    20        FETCH_CLASS_CONSTANT                             ~26     'IntlDateFormatter', 'FULL'
         21        SEND_VAL_EX                                              ~26
   31    22        NEW                                              $27     'DateTimeZone'
         23        SEND_VAR_EX                                              !3
         24        DO_FCALL                                      0          
         25        SEND_VAR_NO_REF_EX                                       $27
   27    26        DO_FCALL                                      0          
         27        ASSIGN                                                   !7, $24
   33    28        NEW                                              $31     'IntlDateFormatter'
   34    29        SEND_VAR_EX                                              !5
   35    30        FETCH_CLASS_CONSTANT                             ~32     'IntlDateFormatter', 'SHORT'
         31        SEND_VAL_EX                                              ~32
   36    32        FETCH_CLASS_CONSTANT                             ~33     'IntlDateFormatter', 'SHORT'
         33        SEND_VAL_EX                                              ~33
   37    34        NEW                                              $34     'DateTimeZone'
         35        SEND_VAR_EX                                              !3
         36        DO_FCALL                                      0          
         37        SEND_VAR_NO_REF_EX                                       $34
   33    38        DO_FCALL                                      0          
         39        ASSIGN                                                   !8, $31
   39    40        NEW                                              $38     'IntlDateFormatter'
   40    41        SEND_VAR_EX                                              !5
   41    42        FETCH_CLASS_CONSTANT                             ~39     'IntlDateFormatter', 'SHORT'
         43        SEND_VAL_EX                                              ~39
   42    44        FETCH_CLASS_CONSTANT                             ~40     'IntlDateFormatter', 'NONE'
         45        SEND_VAL_EX                                              ~40
   43    46        NEW                                              $41     'DateTimeZone'
         47        SEND_VAR_EX                                              !3
         48        DO_FCALL                                      0          
         49        SEND_VAR_NO_REF_EX                                       $41
   39    50        DO_FCALL                                      0          
         51        ASSIGN                                                   !9, $38
   46    52        ROPE_INIT                                     8  ~49     '%0A%0A++++++++The+'
   47    53        ROPE_ADD                                      1  ~49     ~49, !6
         54        ROPE_ADD                                      2  ~49     ~49, '+one+sees%3A%0A++++++++++++-+Full%3A+'
   48    55        INIT_METHOD_CALL                                         !7, 'format'
         56        SEND_VAR_EX                                              !2
         57        DO_FCALL                                      0  $45     
         58        ROPE_ADD                                      3  ~49     ~49, $45
         59        ROPE_ADD                                      4  ~49     ~49, '%0A++++++++++++-+Short%3A+'
   49    60        INIT_METHOD_CALL                                         !8, 'format'
         61        SEND_VAR_EX                                              !2
         62        DO_FCALL                                      0  $46     
         63        ROPE_ADD                                      5  ~49     ~49, $46
         64        ROPE_ADD                                      6  ~49     ~49, '%0A++++++++++++-+Short+date%3A+'
   50    65        INIT_METHOD_CALL                                         !9, 'format'
         66        SEND_VAR_EX                                              !2
         67        DO_FCALL                                      0  $47     
         68        ROPE_END                                      7  ~48     ~49, $47
         69        ECHO                                                     ~48
   26    70      > JMP                                                      ->14
         71    >   FE_FREE                                                  $21
   23    72      > JMP                                                      ->7
         73    >   FE_FREE                                                  $15
   52    74      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.08 ms | 1447 KiB | 13 Q