3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time = new DateTime(); Locale::setDefault('en_GB'); echo IntlDateFormatter::formatObject($time)."\n"; echo IntlDateFormatter::formatObject($time, [IntlDateFormatter::NONE, IntlDateFormatter::MEDIUM])."\n"; echo IntlDateFormatter::formatObject($time, [IntlDateFormatter::MEDIUM, IntlDateFormatter::NONE])."\n"; Locale::setDefault('no_NO'); echo IntlDateFormatter::formatObject($time)."\n"; echo IntlDateFormatter::formatObject($time, [IntlDateFormatter::NONE, IntlDateFormatter::MEDIUM])."\n"; echo IntlDateFormatter::formatObject($time, [IntlDateFormatter::MEDIUM, IntlDateFormatter::NONE])."\n"; Locale::setDefault('en_GB'); $formatter = new IntlDateFormatter(Locale::getDefault(), IntlDateFormatter::MEDIUM, IntlDateFormatter::NONE); echo $formatter->format($time)."\n"; Locale::setDefault('no_NO'); $formatter = new IntlDateFormatter(Locale::getDefault(), IntlDateFormatter::MEDIUM, IntlDateFormatter::NONE); echo $formatter->format($time)."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hoRks
function name:  (null)
number of ops:  96
compiled vars:  !0 = $time, !1 = $formatter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'DateTime'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    4     3        INIT_STATIC_METHOD_CALL                                  'Locale', 'setDefault'
          4        SEND_VAL_EX                                              'en_GB'
          5        DO_FCALL                                      0          
    5     6        INIT_STATIC_METHOD_CALL                                  'IntlDateFormatter', 'formatObject'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0  $6      
          9        CONCAT                                           ~7      $6, '%0A'
         10        ECHO                                                     ~7
    6    11        INIT_STATIC_METHOD_CALL                                  'IntlDateFormatter', 'formatObject'
         12        SEND_VAR_EX                                              !0
         13        FETCH_CLASS_CONSTANT                             ~8      'IntlDateFormatter', 'NONE'
         14        INIT_ARRAY                                       ~9      ~8
         15        FETCH_CLASS_CONSTANT                             ~10     'IntlDateFormatter', 'MEDIUM'
         16        ADD_ARRAY_ELEMENT                                ~9      ~10
         17        SEND_VAL_EX                                              ~9
         18        DO_FCALL                                      0  $11     
         19        CONCAT                                           ~12     $11, '%0A'
         20        ECHO                                                     ~12
    7    21        INIT_STATIC_METHOD_CALL                                  'IntlDateFormatter', 'formatObject'
         22        SEND_VAR_EX                                              !0
         23        FETCH_CLASS_CONSTANT                             ~13     'IntlDateFormatter', 'MEDIUM'
         24        INIT_ARRAY                                       ~14     ~13
         25        FETCH_CLASS_CONSTANT                             ~15     'IntlDateFormatter', 'NONE'
         26        ADD_ARRAY_ELEMENT                                ~14     ~15
         27        SEND_VAL_EX                                              ~14
         28        DO_FCALL                                      0  $16     
         29        CONCAT                                           ~17     $16, '%0A'
         30        ECHO                                                     ~17
    9    31        INIT_STATIC_METHOD_CALL                                  'Locale', 'setDefault'
         32        SEND_VAL_EX                                              'no_NO'
         33        DO_FCALL                                      0          
   10    34        INIT_STATIC_METHOD_CALL                                  'IntlDateFormatter', 'formatObject'
         35        SEND_VAR_EX                                              !0
         36        DO_FCALL                                      0  $19     
         37        CONCAT                                           ~20     $19, '%0A'
         38        ECHO                                                     ~20
   11    39        INIT_STATIC_METHOD_CALL                                  'IntlDateFormatter', 'formatObject'
         40        SEND_VAR_EX                                              !0
         41        FETCH_CLASS_CONSTANT                             ~21     'IntlDateFormatter', 'NONE'
         42        INIT_ARRAY                                       ~22     ~21
         43        FETCH_CLASS_CONSTANT                             ~23     'IntlDateFormatter', 'MEDIUM'
         44        ADD_ARRAY_ELEMENT                                ~22     ~23
         45        SEND_VAL_EX                                              ~22
         46        DO_FCALL                                      0  $24     
         47        CONCAT                                           ~25     $24, '%0A'
         48        ECHO                                                     ~25
   12    49        INIT_STATIC_METHOD_CALL                                  'IntlDateFormatter', 'formatObject'
         50        SEND_VAR_EX                                              !0
         51        FETCH_CLASS_CONSTANT                             ~26     'IntlDateFormatter', 'MEDIUM'
         52        INIT_ARRAY                                       ~27     ~26
         53        FETCH_CLASS_CONSTANT                             ~28     'IntlDateFormatter', 'NONE'
         54        ADD_ARRAY_ELEMENT                                ~27     ~28
         55        SEND_VAL_EX                                              ~27
         56        DO_FCALL                                      0  $29     
         57        CONCAT                                           ~30     $29, '%0A'
         58        ECHO                                                     ~30
   14    59        INIT_STATIC_METHOD_CALL                                  'Locale', 'setDefault'
         60        SEND_VAL_EX                                              'en_GB'
         61        DO_FCALL                                      0          
   15    62        NEW                                              $32     'IntlDateFormatter'
         63        INIT_STATIC_METHOD_CALL                                  'Locale', 'getDefault'
         64        DO_FCALL                                      0  $33     
         65        SEND_VAR_NO_REF_EX                                       $33
         66        FETCH_CLASS_CONSTANT                             ~34     'IntlDateFormatter', 'MEDIUM'
         67        SEND_VAL_EX                                              ~34
         68        FETCH_CLASS_CONSTANT                             ~35     'IntlDateFormatter', 'NONE'
         69        SEND_VAL_EX                                              ~35
         70        DO_FCALL                                      0          
         71        ASSIGN                                                   !1, $32
   16    72        INIT_METHOD_CALL                                         !1, 'format'
         73        SEND_VAR_EX                                              !0
         74        DO_FCALL                                      0  $38     
         75        CONCAT                                           ~39     $38, '%0A'
         76        ECHO                                                     ~39
   18    77        INIT_STATIC_METHOD_CALL                                  'Locale', 'setDefault'
         78        SEND_VAL_EX                                              'no_NO'
         79        DO_FCALL                                      0          
   19    80        NEW                                              $41     'IntlDateFormatter'
         81        INIT_STATIC_METHOD_CALL                                  'Locale', 'getDefault'
         82        DO_FCALL                                      0  $42     
         83        SEND_VAR_NO_REF_EX                                       $42
         84        FETCH_CLASS_CONSTANT                             ~43     'IntlDateFormatter', 'MEDIUM'
         85        SEND_VAL_EX                                              ~43
         86        FETCH_CLASS_CONSTANT                             ~44     'IntlDateFormatter', 'NONE'
         87        SEND_VAL_EX                                              ~44
         88        DO_FCALL                                      0          
         89        ASSIGN                                                   !1, $41
   20    90        INIT_METHOD_CALL                                         !1, 'format'
         91        SEND_VAR_EX                                              !0
         92        DO_FCALL                                      0  $47     
         93        CONCAT                                           ~48     $47, '%0A'
         94        ECHO                                                     ~48
         95      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.7 ms | 1403 KiB | 13 Q