3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function get_month_name($m, $locale = "en_US.UTF-8") { $l = setlocale(LC_ALL, 0); setlocale(LC_ALL, "en_US.UTF-8"); $n = date("F", mktime(0, 0, 0, $m, 10)); setlocale(LC_ALL, $l); return $n; } function get_months($locale = "en_US.UTF-8") { $m = 1; $y = array(); while($m <= 12) { $y[$m++] = get_month_name($m, $locale); } return $y; } var_dump(get_months());
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/aKn0t
function name:  (null)
number of ops:  8
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  15     1        NOP                                                      
  29     2        INIT_FCALL                                               'var_dump'
         3        INIT_FCALL                                               'get_months'
         4        DO_FCALL                                      0  $0      
         5        SEND_VAR                                                 $0
         6        DO_ICALL                                                 
         7      > RETURN                                                   1

Function get_month_name:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/aKn0t
function name:  get_month_name
number of ops:  29
compiled vars:  !0 = $m, !1 = $locale, !2 = $l, !3 = $n
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   RECV                                             !0      
         1        RECV_INIT                                        !1      'en_US.UTF-8'
   5     2        INIT_FCALL                                               'setlocale'
         3        SEND_VAL                                                 6
         4        SEND_VAL                                                 0
         5        DO_ICALL                                         $4      
         6        ASSIGN                                                   !2, $4
   6     7        INIT_FCALL                                               'setlocale'
         8        SEND_VAL                                                 6
         9        SEND_VAL                                                 'en_US.UTF-8'
        10        DO_ICALL                                                 
   8    11        INIT_FCALL                                               'date'
        12        SEND_VAL                                                 'F'
        13        INIT_FCALL                                               'mktime'
        14        SEND_VAL                                                 0
        15        SEND_VAL                                                 0
        16        SEND_VAL                                                 0
        17        SEND_VAR                                                 !0
        18        SEND_VAL                                                 10
        19        DO_ICALL                                         $7      
        20        SEND_VAR                                                 $7
        21        DO_ICALL                                         $8      
        22        ASSIGN                                                   !3, $8
  10    23        INIT_FCALL                                               'setlocale'
        24        SEND_VAL                                                 6
        25        SEND_VAR                                                 !2
        26        DO_ICALL                                                 
  12    27      > RETURN                                                   !3
  13    28*     > RETURN                                                   null

End of function get_month_name

Function get_months:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 11
Branch analysis from position: 11
Jump found. Position 1 = 13, Position 2 = 4
Branch analysis from position: 13
Jump found. Position 1 = -2
Branch analysis from position: 4
Jump found. Position 1 = 13, Position 2 = 4
Branch analysis from position: 13
Branch analysis from position: 4
filename:       /in/aKn0t
function name:  get_months
number of ops:  15
compiled vars:  !0 = $locale, !1 = $m, !2 = $y
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  15     0  E >   RECV_INIT                                        !0      'en_US.UTF-8'
  17     1        ASSIGN                                                   !1, 1
  18     2        ASSIGN                                                   !2, <array>
  20     3      > JMP                                                      ->11
  22     4    >   POST_INC                                         ~5      !1
         5        INIT_FCALL                                               'get_month_name'
         6        SEND_VAR                                                 !1
         7        SEND_VAR                                                 !0
         8        DO_FCALL                                      0  $7      
         9        ASSIGN_DIM                                               !2, ~5
        10        OP_DATA                                                  $7
  20    11    >   IS_SMALLER_OR_EQUAL                              ~8      !1, 12
        12      > JMPNZ                                                    ~8, ->4
  25    13    > > RETURN                                                   !2
  26    14*     > RETURN                                                   null

End of function get_months

Generated using Vulcan Logic Dumper, using php 7.2.0