3v4l.org

run code in 300+ PHP versions simultaneously
<?php function check($s1, $s2) { global $jdeg, $lmon; //var_dump($s1, $s2); $deg1 = $jdeg[$s1]; $deg2 = $jdeg[$s2]; $mon1 = $lmon[$deg1]; $mon2 = $lmon[$deg2]; if( ($deg1 == 270 || $deg2 == 270) || ($deg1 == 0 || $deg2 == 0) || ($deg1 == 90 || $deg2 == 90) || ($deg1 == 180 || $deg2 == 180) ) { if($deg1 == 270 || $deg1 == 0 || $deg1 == 90 || $deg1 == 180) { $ldeg1 = $deg1; $ldeg2 = $deg2; $lmon1 = $mon1; $lmon2 = $mon2; } else { $ldeg1 = $deg2; $ldeg2 = $deg1; $lmon1 = $mon2; $lmon2 = $mon1; } } else { $ldeg1 = $deg1; $ldeg2 = $deg2; $lmon1 = $mon1; $lmon2 = $mon2; } return array($ldeg1, $ldeg2, $lmon1, $lmon2); } function main() { global $lmon, $jdeg, $jung; $lmon = array(330 => 1, 0 => 2, 30 => 3, 60 => 4, 90 => 5, 120 => 6, 150 => 7, 180 => 8, 210 => 9, 240 => 10, 270 => 11, 300 => 12); $jdeg = array( 0 => "270", 1 => "300", 2 => "330", 3 => "0", 4 => "30", 5 => "60", 6 => "90", 7 => "120", 8 => "150", 9 => "180", 10 => "210", 11 => "240", 12 => "270", 13 => "300", 14 => "330", 15 => "0", 16 => "30", 17 => "60", 18 => "90", 19 => "120", 20 => "150", 21 => "180", 22 => "210", 23 => "240", 24 => "270", 25 => "300", 26 => "330", 27 => "0", 28 => "30", 29 => "60", 30 => "90", 31 => "120", 32 => "150", 33 => "180", 34 => "210", 35 => "240", 36 => "270", 37 => "300", 38 => "330", 39 => "0", 40 => "30", 41 => "60", 42 => "90", 43 => "120", 44 => "150", 45 => "180", 46 => "210", 47 => "240", 48 => "270", 49 => "300", 50 => "330", 51 => "0", 52 => "30", 53 => "60", 54 => "90", 55 => "120", 56 => "150", 57 => "180", 58 => "210", 59 => "240", 60 => "270", 61 => "300", 62 => "330", 63 => "0", 64 => "30", 65 => "60", 66 => "90", 67 => "120", 68 => "150", 69 => "180", 70 => "210", 71 => "240", 72 => "270", 73 => "300", 74 => "330", 75 => "0", 76 => "30", 77 => "60", 78 => "90", 79 => "120", 80 => "150", 81 => "180", 82 => "210", 83 => "240", 84 => "270", 85 => "300", 86 => "330", 87 => "0", 88 => "30", 89 => "60", 90 => "90", 91 => "120", 92 => "150", 93 => "180", 94 => "210", 95 => "240", 96 => "270", 97 => "300", 98 => "330", 99 => "0", 100 => "30", 101 => "60", 102 => "90", 103 => "120", 104 => "150"); $jung = array( 0 => "0", 1 => "1", 2 => "2", 3 => "3", 4 => "4", 5 => "5", 6 => "6", 7 => "7", 8 => "8", 9 => "9", 10 => "10", 11 => "11", 12 => "12", 13 => "13", 14 => "14", 15 => "15", 16 => "16", 17 => "17", 18 => "18", 19 => "19", 20 => "20", 21 => "21", 22 => "22", 23 => "23", 24 => "24", 25 => "-1", 26 => "25", 27 => "26", 28 => "27", 29 => "28", 30 => "29", 31 => "30", 32 => "31", 33 => "32", 34 => "33", 35 => "34", 36 => "35", 37 => "36", 38 => "37", 39 => "38", 40 => "39", 41 => "40", 42 => "41", 43 => "42", 44 => "43", 45 => "44", 46 => "45", 47 => "46", 48 => "47", 49 => "48", 50 => "49", 51 => "50", 52 => "51", 53 => "52", 54 => "53", 55 => "-1", 56 => "54", 57 => "55.56", 58 => "-1", 59 => "57.58", 60 => "-1", 61 => "59", 62 => "60", 63 => "61", 64 => "62", 65 => "63", 66 => "64", 67 => "65", 68 => "66", 69 => "67", 70 => "68", 71 => "69", 72 => "70", 73 => "71", 74 => "72", 75 => "73", 76 => "74", 77 => "75", 78 => "76", 79 => "77", 80 => "78", 81 => "79", 82 => "80", 83 => "81", 84 => "82", 85 => "83", 86 => "84", 87 => "85", 88 => "86", 89 => "87", 90 => "-1", 91 => "88", 92 => "89", 93 => "90", 94 => "91", 95 => "92", 96 => "93", 97 => "94", 98 => "95", 99 => "96", 100 => "97"); test(); } function test() { global $lmon, $jdeg, $jung; for($j=0; $j<1000; $j++) { for($i=0; $i<100; $i++) { $r = $jung[$i]; if(preg_match("/\./", $r)) { $s = preg_split("/\./", $r); $s0 = $s[0]; $s1 = $s[1]; //var_dump($s); $r = check($s0, $s1); echo "[$j][$i] : $r[0], $r[1], $r[2], $r[3]\n"; } } } } main();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h4RTP
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  124     0  E >   INIT_FCALL                                               'main'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function check:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
2 jumps found. (Code = 47) Position 1 = 17, Position 2 = 22
Branch analysis from position: 17
2 jumps found. (Code = 47) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
2 jumps found. (Code = 47) Position 1 = 23, Position 2 = 28
Branch analysis from position: 23
2 jumps found. (Code = 47) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
2 jumps found. (Code = 47) Position 1 = 29, Position 2 = 34
Branch analysis from position: 29
2 jumps found. (Code = 47) Position 1 = 31, Position 2 = 33
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 56
Branch analysis from position: 35
2 jumps found. (Code = 47) Position 1 = 37, Position 2 = 39
Branch analysis from position: 37
2 jumps found. (Code = 47) Position 1 = 40, Position 2 = 42
Branch analysis from position: 40
2 jumps found. (Code = 47) Position 1 = 43, Position 2 = 45
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 51
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
1 jumps found. (Code = 42) Position 1 = 60
Branch analysis from position: 60
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 51
1 jumps found. (Code = 42) Position 1 = 60
Branch analysis from position: 60
Branch analysis from position: 45
Branch analysis from position: 42
Branch analysis from position: 39
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
Branch analysis from position: 34
Branch analysis from position: 27
Branch analysis from position: 28
Branch analysis from position: 21
Branch analysis from position: 22
Branch analysis from position: 16
filename:       /in/h4RTP
function name:  check
number of ops:  66
compiled vars:  !0 = $s1, !1 = $s2, !2 = $jdeg, !3 = $lmon, !4 = $deg1, !5 = $deg2, !6 = $mon1, !7 = $mon2, !8 = $ldeg1, !9 = $ldeg2, !10 = $lmon1, !11 = $lmon2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        BIND_GLOBAL                                              !2, 'jdeg'
          3        BIND_GLOBAL                                              !3, 'lmon'
    9     4        FETCH_DIM_R                                      ~12     !2, !0
          5        ASSIGN                                                   !4, ~12
   10     6        FETCH_DIM_R                                      ~14     !2, !1
          7        ASSIGN                                                   !5, ~14
   11     8        FETCH_DIM_R                                      ~16     !3, !4
          9        ASSIGN                                                   !6, ~16
   12    10        FETCH_DIM_R                                      ~18     !3, !5
         11        ASSIGN                                                   !7, ~18
   14    12        IS_EQUAL                                         ~20     !4, 270
         13      > JMPNZ_EX                                         ~20     ~20, ->16
         14    >   IS_EQUAL                                         ~21     !5, 270
         15        BOOL                                             ~20     ~21
         16    > > JMPNZ_EX                                         ~20     ~20, ->22
   15    17    >   IS_EQUAL                                         ~22     !4, 0
         18      > JMPNZ_EX                                         ~22     ~22, ->21
         19    >   IS_EQUAL                                         ~23     !5, 0
         20        BOOL                                             ~22     ~23
         21    >   BOOL                                             ~20     ~22
         22    > > JMPNZ_EX                                         ~20     ~20, ->28
   16    23    >   IS_EQUAL                                         ~24     !4, 90
         24      > JMPNZ_EX                                         ~24     ~24, ->27
         25    >   IS_EQUAL                                         ~25     !5, 90
         26        BOOL                                             ~24     ~25
         27    >   BOOL                                             ~20     ~24
         28    > > JMPNZ_EX                                         ~20     ~20, ->34
   17    29    >   IS_EQUAL                                         ~26     !4, 180
         30      > JMPNZ_EX                                         ~26     ~26, ->33
         31    >   IS_EQUAL                                         ~27     !5, 180
         32        BOOL                                             ~26     ~27
         33    >   BOOL                                             ~20     ~26
         34    > > JMPZ                                                     ~20, ->56
   19    35    >   IS_EQUAL                                         ~28     !4, 270
         36      > JMPNZ_EX                                         ~28     ~28, ->39
         37    >   IS_EQUAL                                         ~29     !4, 0
         38        BOOL                                             ~28     ~29
         39    > > JMPNZ_EX                                         ~28     ~28, ->42
         40    >   IS_EQUAL                                         ~30     !4, 90
         41        BOOL                                             ~28     ~30
         42    > > JMPNZ_EX                                         ~28     ~28, ->45
         43    >   IS_EQUAL                                         ~31     !4, 180
         44        BOOL                                             ~28     ~31
         45    > > JMPZ                                                     ~28, ->51
   20    46    >   ASSIGN                                                   !8, !4
   21    47        ASSIGN                                                   !9, !5
   23    48        ASSIGN                                                   !10, !6
   24    49        ASSIGN                                                   !11, !7
         50      > JMP                                                      ->55
   26    51    >   ASSIGN                                                   !8, !5
   27    52        ASSIGN                                                   !9, !4
   29    53        ASSIGN                                                   !10, !7
   30    54        ASSIGN                                                   !11, !6
         55    > > JMP                                                      ->60
   33    56    >   ASSIGN                                                   !8, !4
   34    57        ASSIGN                                                   !9, !5
   36    58        ASSIGN                                                   !10, !6
   37    59        ASSIGN                                                   !11, !7
   40    60    >   INIT_ARRAY                                       ~44     !8
         61        ADD_ARRAY_ELEMENT                                ~44     !9
         62        ADD_ARRAY_ELEMENT                                ~44     !10
         63        ADD_ARRAY_ELEMENT                                ~44     !11
         64      > RETURN                                                   ~44
   41    65*     > RETURN                                                   null

End of function check

Function main:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h4RTP
function name:  main
number of ops:  9
compiled vars:  !0 = $lmon, !1 = $jdeg, !2 = $jung
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   45     0  E >   BIND_GLOBAL                                              !0, 'lmon'
          1        BIND_GLOBAL                                              !1, 'jdeg'
          2        BIND_GLOBAL                                              !2, 'jung'
   47     3        ASSIGN                                                   !0, <array>
   50     4        ASSIGN                                                   !1, <array>
   73     5        ASSIGN                                                   !2, <array>
   95     6        INIT_FCALL_BY_NAME                                       'test'
          7        DO_FCALL                                      0          
   96     8      > RETURN                                                   null

End of function main

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 52, Position 2 = 5
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 7
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 52, Position 2 = 5
Branch analysis from position: 52
Branch analysis from position: 5
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 46
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 7
Branch analysis from position: 49
Branch analysis from position: 7
Branch analysis from position: 46
filename:       /in/h4RTP
function name:  test
number of ops:  53
compiled vars:  !0 = $lmon, !1 = $jdeg, !2 = $jung, !3 = $j, !4 = $i, !5 = $r, !6 = $s, !7 = $s0, !8 = $s1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  101     0  E >   BIND_GLOBAL                                              !0, 'lmon'
          1        BIND_GLOBAL                                              !1, 'jdeg'
          2        BIND_GLOBAL                                              !2, 'jung'
  104     3        ASSIGN                                                   !3, 0
          4      > JMP                                                      ->50
  106     5    >   ASSIGN                                                   !4, 0
          6      > JMP                                                      ->47
  107     7    >   FETCH_DIM_R                                      ~11     !2, !4
          8        ASSIGN                                                   !5, ~11
  109     9        INIT_FCALL                                               'preg_match'
         10        SEND_VAL                                                 '%2F%5C.%2F'
         11        SEND_VAR                                                 !5
         12        DO_ICALL                                         $13     
         13      > JMPZ                                                     $13, ->46
  111    14    >   INIT_FCALL                                               'preg_split'
         15        SEND_VAL                                                 '%2F%5C.%2F'
         16        SEND_VAR                                                 !5
         17        DO_ICALL                                         $14     
         18        ASSIGN                                                   !6, $14
  112    19        FETCH_DIM_R                                      ~16     !6, 0
         20        ASSIGN                                                   !7, ~16
  113    21        FETCH_DIM_R                                      ~18     !6, 1
         22        ASSIGN                                                   !8, ~18
  116    23        INIT_FCALL                                               'check'
         24        SEND_VAR                                                 !7
         25        SEND_VAR                                                 !8
         26        DO_FCALL                                      0  $20     
         27        ASSIGN                                                   !5, $20
  117    28        ROPE_INIT                                    13  ~27     '%5B'
         29        ROPE_ADD                                      1  ~27     ~27, !3
         30        ROPE_ADD                                      2  ~27     ~27, '%5D%5B'
         31        ROPE_ADD                                      3  ~27     ~27, !4
         32        ROPE_ADD                                      4  ~27     ~27, '%5D+%3A+'
         33        FETCH_DIM_R                                      ~22     !5, 0
         34        ROPE_ADD                                      5  ~27     ~27, ~22
         35        ROPE_ADD                                      6  ~27     ~27, '%2C+'
         36        FETCH_DIM_R                                      ~23     !5, 1
         37        ROPE_ADD                                      7  ~27     ~27, ~23
         38        ROPE_ADD                                      8  ~27     ~27, '%2C+'
         39        FETCH_DIM_R                                      ~24     !5, 2
         40        ROPE_ADD                                      9  ~27     ~27, ~24
         41        ROPE_ADD                                     10  ~27     ~27, '%2C+'
         42        FETCH_DIM_R                                      ~25     !5, 3
         43        ROPE_ADD                                     11  ~27     ~27, ~25
         44        ROPE_END                                     12  ~26     ~27, '%0A'
         45        ECHO                                                     ~26
  106    46    >   PRE_INC                                                  !4
         47    >   IS_SMALLER                                               !4, 100
         48      > JMPNZ                                                    ~35, ->7
  104    49    >   PRE_INC                                                  !3
         50    >   IS_SMALLER                                               !3, 1000
         51      > JMPNZ                                                    ~37, ->5
  122    52    > > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.35 ms | 1411 KiB | 19 Q