3v4l.org

run code in 300+ PHP versions simultaneously
<?php function formatted_month($month) { $first_day_in_month = new DateTime('2022-01-01'); $fmt = datefmt_create( 'fr_FR', IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'Europe/Paris', IntlDateFormatter::GREGORIAN, 'MMMM YY' ); $formatted_month = datefmt_format($fmt,$first_day_in_month); return $formatted_month; } function formatted_month2($month) { $first_day_in_month = new DateTime('2022-01-01'); $fmt = datefmt_create( 'en_EN', IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'Europe/Paris', IntlDateFormatter::GREGORIAN, 'MMMM YY' ); $formatted_month = datefmt_format($fmt,$first_day_in_month); return $formatted_month; } echo formatted_month(1); echo PHP_EOL; echo formatted_month2(1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9sITi
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   INIT_FCALL                                               'formatted_month'
          1        SEND_VAL                                                 1
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   36     4        ECHO                                                     '%0A'
   37     5        INIT_FCALL                                               'formatted_month2'
          6        SEND_VAL                                                 1
          7        DO_FCALL                                      0  $1      
          8        ECHO                                                     $1
          9      > RETURN                                                   1

Function formatted_month:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9sITi
function name:  formatted_month
number of ops:  24
compiled vars:  !0 = $month, !1 = $first_day_in_month, !2 = $fmt, !3 = $formatted_month
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        NEW                                              $4      'DateTime'
          2        SEND_VAL_EX                                              '2022-01-01'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
    6     5        INIT_FCALL_BY_NAME                                       'datefmt_create'
    7     6        SEND_VAL_EX                                              'fr_FR'
    8     7        FETCH_CLASS_CONSTANT                             ~7      'IntlDateFormatter', 'FULL'
          8        SEND_VAL_EX                                              ~7
    9     9        FETCH_CLASS_CONSTANT                             ~8      'IntlDateFormatter', 'FULL'
         10        SEND_VAL_EX                                              ~8
   10    11        SEND_VAL_EX                                              'Europe%2FParis'
   11    12        FETCH_CLASS_CONSTANT                             ~9      'IntlDateFormatter', 'GREGORIAN'
         13        SEND_VAL_EX                                              ~9
   12    14        SEND_VAL_EX                                              'MMMM+YY'
    6    15        DO_FCALL                                      0  $10     
         16        ASSIGN                                                   !2, $10
   14    17        INIT_FCALL_BY_NAME                                       'datefmt_format'
         18        SEND_VAR_EX                                              !2
         19        SEND_VAR_EX                                              !1
         20        DO_FCALL                                      0  $12     
         21        ASSIGN                                                   !3, $12
   16    22      > RETURN                                                   !3
   17    23*     > RETURN                                                   null

End of function formatted_month

Function formatted_month2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9sITi
function name:  formatted_month2
number of ops:  24
compiled vars:  !0 = $month, !1 = $first_day_in_month, !2 = $fmt, !3 = $formatted_month
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        NEW                                              $4      'DateTime'
          2        SEND_VAL_EX                                              '2022-01-01'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
   22     5        INIT_FCALL_BY_NAME                                       'datefmt_create'
   23     6        SEND_VAL_EX                                              'en_EN'
   24     7        FETCH_CLASS_CONSTANT                             ~7      'IntlDateFormatter', 'FULL'
          8        SEND_VAL_EX                                              ~7
   25     9        FETCH_CLASS_CONSTANT                             ~8      'IntlDateFormatter', 'FULL'
         10        SEND_VAL_EX                                              ~8
   26    11        SEND_VAL_EX                                              'Europe%2FParis'
   27    12        FETCH_CLASS_CONSTANT                             ~9      'IntlDateFormatter', 'GREGORIAN'
         13        SEND_VAL_EX                                              ~9
   28    14        SEND_VAL_EX                                              'MMMM+YY'
   22    15        DO_FCALL                                      0  $10     
         16        ASSIGN                                                   !2, $10
   30    17        INIT_FCALL_BY_NAME                                       'datefmt_format'
         18        SEND_VAR_EX                                              !2
         19        SEND_VAR_EX                                              !1
         20        DO_FCALL                                      0  $12     
         21        ASSIGN                                                   !3, $12
   32    22      > RETURN                                                   !3
   33    23*     > RETURN                                                   null

End of function formatted_month2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
129.71 ms | 1005 KiB | 15 Q