3v4l.org

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

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

End of function createlocalizedmonthname

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.93 ms | 1403 KiB | 16 Q