3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Get Localized month name * @param int $month * @param string $locale * @param string $format * @return string */ function getLocalizedMonthName($month, $locale, $format = "LLLL") { $dateFormatter = new IntlDateFormatter($locale, IntlDateFormatter::FULL, IntlDateFormatter::FULL); $dateFormatter->setPattern($format); return $dateFormatter->format(mktime(0, 0, 0, $month)); } $locales = ['pl_PL', 'en-US']; foreach ($locales as $locale) { foreach (range(1, 12) as $monthNumber) { echo $monthNumber . " - " . getLocalizedMonthName($monthNumber, $locale) . PHP_EOL; } echo PHP_EOL . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 21
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 21
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 18
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 18
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 18
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/bSRkm
function name:  (null)
number of ops:  23
compiled vars:  !0 = $locales, !1 = $locale, !2 = $monthNumber
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, <array>
   18     1      > FE_RESET_R                                       $4      !0, ->21
          2    > > FE_FETCH_R                                               $4, !1, ->21
   19     3    >   INIT_FCALL                                               'range'
          4        SEND_VAL                                                 1
          5        SEND_VAL                                                 12
          6        DO_ICALL                                         $5      
          7      > FE_RESET_R                                       $6      $5, ->18
          8    > > FE_FETCH_R                                               $6, !2, ->18
   20     9    >   CONCAT                                           ~7      !2, '+-+'
         10        INIT_FCALL                                               'getlocalizedmonthname'
         11        SEND_VAR                                                 !2
         12        SEND_VAR                                                 !1
         13        DO_FCALL                                      0  $8      
         14        CONCAT                                           ~9      ~7, $8
         15        CONCAT                                           ~10     ~9, '%0A'
         16        ECHO                                                     ~10
   19    17      > JMP                                                      ->8
         18    >   FE_FREE                                                  $6
   22    19        ECHO                                                     '%0A%0A'
   18    20      > JMP                                                      ->2
         21    >   FE_FREE                                                  $4
   25    22      > RETURN                                                   1

Function getlocalizedmonthname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bSRkm
function name:  getLocalizedMonthName
number of ops:  25
compiled vars:  !0 = $month, !1 = $locale, !2 = $format, !3 = $dateFormatter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      'LLLL'
   11     3        NEW                                              $4      'IntlDateFormatter'
          4        SEND_VAR_EX                                              !1
          5        FETCH_CLASS_CONSTANT                             ~5      'IntlDateFormatter', 'FULL'
          6        SEND_VAL_EX                                              ~5
          7        FETCH_CLASS_CONSTANT                             ~6      'IntlDateFormatter', 'FULL'
          8        SEND_VAL_EX                                              ~6
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !3, $4
   12    11        INIT_METHOD_CALL                                         !3, 'setPattern'
         12        SEND_VAR_EX                                              !2
         13        DO_FCALL                                      0          
   13    14        INIT_METHOD_CALL                                         !3, 'format'
         15        INIT_FCALL                                               'mktime'
         16        SEND_VAL                                                 0
         17        SEND_VAL                                                 0
         18        SEND_VAL                                                 0
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $10     
         21        SEND_VAR_NO_REF_EX                                       $10
         22        DO_FCALL                                      0  $11     
         23      > RETURN                                                   $11
   15    24*     > RETURN                                                   null

End of function getlocalizedmonthname

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.05 ms | 1403 KiB | 18 Q