3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * 计算星座的函数 string get_zodiac_sign(string month, string day) * 输入:月份,日期 * 输出:星座名称或者错误信息 */ function get_zodiac_sign($month, $day) { // 检查参数有效性 if ($month < 1 || $month > 12 || $day < 1 || $day > 31) return (false); // 星座名称以及开始日期 $signs = array( array( "20" => "宝瓶座"), array( "19" => "双鱼座"), array( "21" => "白羊座"), array( "20" => "金牛座"), array( "21" => "双子座"), array( "22" => "巨蟹座"), array( "23" => "狮子座"), array( "23" => "处女座"), array( "23" => "天秤座"), array( "24" => "天蝎座"), array( "22" => "射手座"), array( "22" => "摩羯座") ); list($sign_start, $sign_name) = each($signs[(int)$month-1]); if ($day < $sign_start) list($sign_start, $sign_name) = each($signs[($month -2 < 0) ? $month = 11: $month -= 2]); return $sign_name; }//函数结束 ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QGR3r
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E > > RETURN                                                   1

Function get_zodiac_sign:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
2 jumps found. (Code = 47) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
2 jumps found. (Code = 47) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 47
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 37
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
Branch analysis from position: 12
Branch analysis from position: 9
Branch analysis from position: 6
filename:       /in/QGR3r
function name:  get_zodiac_sign
number of ops:  49
compiled vars:  !0 = $month, !1 = $day, !2 = $signs, !3 = $sign_start, !4 = $sign_name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        IS_SMALLER                                       ~5      !0, 1
          3      > JMPNZ_EX                                         ~5      ~5, ->6
          4    >   IS_SMALLER                                       ~6      12, !0
          5        BOOL                                             ~5      ~6
          6    > > JMPNZ_EX                                         ~5      ~5, ->9
          7    >   IS_SMALLER                                       ~7      !1, 1
          8        BOOL                                             ~5      ~7
          9    > > JMPNZ_EX                                         ~5      ~5, ->12
         10    >   IS_SMALLER                                       ~8      31, !1
         11        BOOL                                             ~5      ~8
         12    > > JMPZ                                                     ~5, ->14
   12    13    > > RETURN                                                   <false>
   14    14    >   ASSIGN                                                   !2, <array>
   28    15        INIT_FCALL_BY_NAME                                       'each'
         16        CHECK_FUNC_ARG                                           
         17        CAST                                          4  ~10     !0
         18        SUB                                              ~11     ~10, 1
         19        FETCH_DIM_FUNC_ARG                               $12     !2, ~11
         20        SEND_FUNC_ARG                                            $12
         21        DO_FCALL                                      0  $13     
         22        FETCH_LIST_R                                     $14     $13, 0
         23        ASSIGN                                                   !3, $14
         24        FETCH_LIST_R                                     $16     $13, 1
         25        ASSIGN                                                   !4, $16
         26        FREE                                                     $13
   29    27        IS_SMALLER                                               !1, !3
         28      > JMPZ                                                     ~18, ->47
   30    29    >   INIT_FCALL_BY_NAME                                       'each'
         30        CHECK_FUNC_ARG                                           
         31        SUB                                              ~19     !0, 2
         32        IS_SMALLER                                               ~19, 0
         33      > JMPZ                                                     ~20, ->37
         34    >   ASSIGN                                           ~21     !0, 11
         35        QM_ASSIGN                                        ~22     ~21
         36      > JMP                                                      ->39
         37    >   ASSIGN_OP                                     2  ~23     !0, 2
         38        QM_ASSIGN                                        ~22     ~23
         39    >   FETCH_DIM_FUNC_ARG                               $24     !2, ~22
         40        SEND_FUNC_ARG                                            $24
         41        DO_FCALL                                      0  $25     
         42        FETCH_LIST_R                                     $26     $25, 0
         43        ASSIGN                                                   !3, $26
         44        FETCH_LIST_R                                     $28     $25, 1
         45        ASSIGN                                                   !4, $28
         46        FREE                                                     $25
   31    47    > > RETURN                                                   !4
   32    48*     > RETURN                                                   null

End of function get_zodiac_sign

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.14 ms | 1399 KiB | 13 Q