3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo '<form action="" method="post">'; echo '<fieldset>'; echo '<legend>Калькулятор (с использованием 1-го числа)</legend>'; echo '<input type="text" name="c" size="8" />'; echo '<select name="d">'; echo '<option value="na"> </option>'; echo '<option value="cos">cos</option>'; echo '<option value="sin">sin</option>'; echo '<option value="sqr2">x&#178;</option>'; echo '<option value="sqr3">x&#179;</option>'; echo '<option value="sqrt">&#172;</option>'; echo '</select>'; echo '<input type="submit" value="=" />'; $c = $_POST['c']; $d = $_POST['d']; if (isset($_POST['c'])) { switch($d) { case 'na': echo "Виберите действие!"; break; case 'cos': $result6 = cos($c); echo "cos($c) = <b>$result6</b>"; break; case 'sin': $result5 = sin($c); echo "sin($c) = <b>$result5</b>"; break; case 'sqr2': $result8 = pow($c,2); echo "($c)&#178; = <b>$result8</b>"; break; case 'sqr3': $result9 = pow($c,3); echo "($c)&#179; = <b>$result9</b>"; break; case 'sqrt': $result7 = sqrt($c); echo "Корень($c) = <b>$result7</b>"; break; return; } } echo '</fieldset></form>'; echo '<form action="" method="post">'; echo '<fieldset>'; echo '<legend>Калькулятор (с использованием 2-х чисел)</legend>'; echo '<input type="text" name="a" size="8" />'; echo '<select name="q">'; echo '<option value="no"> </option>'; echo '<option value="add">+</option>'; echo '<option value="min">-</option>'; echo '<option value="um">*</option>'; echo '<option value="pod">&#247;</option>'; echo '</select>'; echo '<input type="text" name="b" size="8" />'; echo '<input type="submit" value="=" />'; $a = $_POST['a']; $b = $_POST['b']; $q = $_POST['q']; if (isset($_POST['a']) && isset($_POST['b'])) { switch($q) { case 'no': echo "Виберите действие!"; break; case 'add': $result = $a + $b; echo "$a + $b = <b>$result</b>"; break; case 'min': $result1 = $a - $b; echo "$a - $b = <b>$result1</b>"; break; case 'um': $result2 = $a * $b; echo "$a * $b = <b>$result2</b>"; break; case 'pod': if ($b == '' or $b == 0) { echo "Деление на 0 не возможно! <br>"; } else { $result3 = $a / $b; echo "$a / $b = <b>$result3</b>"; } break; } return; } echo '</fieldset></form>'; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 96
Branch analysis from position: 22
8 jumps found. (Code = 188) Position 1 = 36, Position 2 = 38, Position 3 = 49, Position 4 = 60, Position 5 = 72, Position 6 = 84, Position 7 = 96, Position 8 = 23
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
2 jumps found. (Code = 46) Position 1 = 122, Position 2 = 125
Branch analysis from position: 122
2 jumps found. (Code = 43) Position 1 = 126, Position 2 = 188
Branch analysis from position: 126
7 jumps found. (Code = 188) Position 1 = 138, Position 2 = 140, Position 3 = 150, Position 4 = 160, Position 5 = 170, Position 6 = 187, Position 7 = 127
Branch analysis from position: 138
1 jumps found. (Code = 42) Position 1 = 187
Branch analysis from position: 187
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 140
1 jumps found. (Code = 42) Position 1 = 187
Branch analysis from position: 187
Branch analysis from position: 150
1 jumps found. (Code = 42) Position 1 = 187
Branch analysis from position: 187
Branch analysis from position: 160
1 jumps found. (Code = 42) Position 1 = 187
Branch analysis from position: 187
Branch analysis from position: 170
2 jumps found. (Code = 47) Position 1 = 172, Position 2 = 174
Branch analysis from position: 172
2 jumps found. (Code = 43) Position 1 = 175, Position 2 = 177
Branch analysis from position: 175
1 jumps found. (Code = 42) Position 1 = 186
Branch analysis from position: 186
1 jumps found. (Code = 42) Position 1 = 187
Branch analysis from position: 187
Branch analysis from position: 177
1 jumps found. (Code = 42) Position 1 = 187
Branch analysis from position: 187
Branch analysis from position: 174
Branch analysis from position: 187
Branch analysis from position: 127
2 jumps found. (Code = 44) Position 1 = 129, Position 2 = 138
Branch analysis from position: 129
2 jumps found. (Code = 44) Position 1 = 131, Position 2 = 140
Branch analysis from position: 131
2 jumps found. (Code = 44) Position 1 = 133, Position 2 = 150
Branch analysis from position: 133
2 jumps found. (Code = 44) Position 1 = 135, Position 2 = 160
Branch analysis from position: 135
2 jumps found. (Code = 44) Position 1 = 137, Position 2 = 170
Branch analysis from position: 137
1 jumps found. (Code = 42) Position 1 = 187
Branch analysis from position: 187
Branch analysis from position: 170
Branch analysis from position: 160
Branch analysis from position: 150
Branch analysis from position: 140
Branch analysis from position: 138
Branch analysis from position: 188
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 125
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
Branch analysis from position: 72
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
Branch analysis from position: 84
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
Branch analysis from position: 96
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 36
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 38
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 49
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 60
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 72
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 84
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
Branch analysis from position: 84
Branch analysis from position: 72
Branch analysis from position: 60
Branch analysis from position: 49
Branch analysis from position: 38
Branch analysis from position: 36
Branch analysis from position: 96
filename:       /in/PNcjd
function name:  (null)
number of ops:  190
compiled vars:  !0 = $c, !1 = $d, !2 = $result6, !3 = $result5, !4 = $result8, !5 = $result9, !6 = $result7, !7 = $a, !8 = $b, !9 = $q, !10 = $result, !11 = $result1, !12 = $result2, !13 = $result3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ECHO                                                     '%3Cform+action%3D%22%22+method%3D%22post%22%3E'
    3     1        ECHO                                                     '%3Cfieldset%3E'
    4     2        ECHO                                                     '%3Clegend%3E%D0%9A%D0%B0%D0%BB%D1%8C%D0%BA%D1%83%D0%BB%D1%8F%D1%82%D0%BE%D1%80+%28%D1%81+%D0%B8%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5%D0%BC+1-%D0%B3%D0%BE+%D1%87%D0%B8%D1%81%D0%BB%D0%B0%29%3C%2Flegend%3E'
    5     3        ECHO                                                     '%3Cinput+type%3D%22text%22+name%3D%22c%22+size%3D%228%22+%2F%3E'
    6     4        ECHO                                                     '%3Cselect+name%3D%22d%22%3E'
    7     5        ECHO                                                     '%3Coption+value%3D%22na%22%3E+%3C%2Foption%3E'
    8     6        ECHO                                                     '%3Coption+value%3D%22cos%22%3Ecos%3C%2Foption%3E'
    9     7        ECHO                                                     '%3Coption+value%3D%22sin%22%3Esin%3C%2Foption%3E'
   10     8        ECHO                                                     '%3Coption+value%3D%22sqr2%22%3Ex%26%23178%3B%3C%2Foption%3E'
   11     9        ECHO                                                     '%3Coption+value%3D%22sqr3%22%3Ex%26%23179%3B%3C%2Foption%3E'
   12    10        ECHO                                                     '%3Coption+value%3D%22sqrt%22%3E%26%23172%3B%3C%2Foption%3E'
   13    11        ECHO                                                     '%3C%2Fselect%3E'
   14    12        ECHO                                                     '%3Cinput+type%3D%22submit%22+value%3D%22%3D%22+%2F%3E'
   16    13        FETCH_R                      global              ~14     '_POST'
         14        FETCH_DIM_R                                      ~15     ~14, 'c'
         15        ASSIGN                                                   !0, ~15
   17    16        FETCH_R                      global              ~17     '_POST'
         17        FETCH_DIM_R                                      ~18     ~17, 'd'
         18        ASSIGN                                                   !1, ~18
   18    19        FETCH_IS                                         ~20     '_POST'
         20        ISSET_ISEMPTY_DIM_OBJ                         0          ~20, 'c'
         21      > JMPZ                                                     ~21, ->96
   20    22    > > SWITCH_STRING                                            !1, [ 'na':->36, 'cos':->38, 'sin':->49, 'sqr2':->60, 'sqr3':->72, 'sqrt':->84, ], ->96
   22    23    >   IS_EQUAL                                                 !1, 'na'
         24      > JMPNZ                                                    ~22, ->36
   25    25    >   IS_EQUAL                                                 !1, 'cos'
         26      > JMPNZ                                                    ~22, ->38
   29    27    >   IS_EQUAL                                                 !1, 'sin'
         28      > JMPNZ                                                    ~22, ->49
   33    29    >   IS_EQUAL                                                 !1, 'sqr2'
         30      > JMPNZ                                                    ~22, ->60
   37    31    >   IS_EQUAL                                                 !1, 'sqr3'
         32      > JMPNZ                                                    ~22, ->72
   41    33    >   IS_EQUAL                                                 !1, 'sqrt'
         34      > JMPNZ                                                    ~22, ->84
         35    > > JMP                                                      ->96
   23    36    >   ECHO                                                     '%D0%92%D0%B8%D0%B1%D0%B5%D1%80%D0%B8%D1%82%D0%B5+%D0%B4%D0%B5%D0%B9%D1%81%D1%82%D0%B2%D0%B8%D0%B5%21'
   24    37      > JMP                                                      ->96
   26    38    >   INIT_FCALL                                               'cos'
         39        SEND_VAR                                                 !0
         40        DO_ICALL                                         $23     
         41        ASSIGN                                                   !2, $23
   27    42        ROPE_INIT                                     5  ~26     'cos%28'
         43        ROPE_ADD                                      1  ~26     ~26, !0
         44        ROPE_ADD                                      2  ~26     ~26, '%29+%3D+%3Cb%3E'
         45        ROPE_ADD                                      3  ~26     ~26, !2
         46        ROPE_END                                      4  ~25     ~26, '%3C%2Fb%3E'
         47        ECHO                                                     ~25
   28    48      > JMP                                                      ->96
   30    49    >   INIT_FCALL                                               'sin'
         50        SEND_VAR                                                 !0
         51        DO_ICALL                                         $29     
         52        ASSIGN                                                   !3, $29
   31    53        ROPE_INIT                                     5  ~32     'sin%28'
         54        ROPE_ADD                                      1  ~32     ~32, !0
         55        ROPE_ADD                                      2  ~32     ~32, '%29+%3D+%3Cb%3E'
         56        ROPE_ADD                                      3  ~32     ~32, !3
         57        ROPE_END                                      4  ~31     ~32, '%3C%2Fb%3E'
         58        ECHO                                                     ~31
   32    59      > JMP                                                      ->96
   34    60    >   INIT_FCALL                                               'pow'
         61        SEND_VAR                                                 !0
         62        SEND_VAL                                                 2
         63        DO_ICALL                                         $35     
         64        ASSIGN                                                   !4, $35
   35    65        ROPE_INIT                                     5  ~38     '%28'
         66        ROPE_ADD                                      1  ~38     ~38, !0
         67        ROPE_ADD                                      2  ~38     ~38, '%29%26%23178%3B+%3D+%3Cb%3E'
         68        ROPE_ADD                                      3  ~38     ~38, !4
         69        ROPE_END                                      4  ~37     ~38, '%3C%2Fb%3E'
         70        ECHO                                                     ~37
   36    71      > JMP                                                      ->96
   38    72    >   INIT_FCALL                                               'pow'
         73        SEND_VAR                                                 !0
         74        SEND_VAL                                                 3
         75        DO_ICALL                                         $41     
         76        ASSIGN                                                   !5, $41
   39    77        ROPE_INIT                                     5  ~44     '%28'
         78        ROPE_ADD                                      1  ~44     ~44, !0
         79        ROPE_ADD                                      2  ~44     ~44, '%29%26%23179%3B+%3D+%3Cb%3E'
         80        ROPE_ADD                                      3  ~44     ~44, !5
         81        ROPE_END                                      4  ~43     ~44, '%3C%2Fb%3E'
         82        ECHO                                                     ~43
   40    83      > JMP                                                      ->96
   42    84    >   INIT_FCALL                                               'sqrt'
         85        SEND_VAR                                                 !0
         86        DO_ICALL                                         $47     
         87        ASSIGN                                                   !6, $47
   43    88        ROPE_INIT                                     5  ~50     '%D0%9A%D0%BE%D1%80%D0%B5%D0%BD%D1%8C%28'
         89        ROPE_ADD                                      1  ~50     ~50, !0
         90        ROPE_ADD                                      2  ~50     ~50, '%29+%3D+%3Cb%3E'
         91        ROPE_ADD                                      3  ~50     ~50, !6
         92        ROPE_END                                      4  ~49     ~50, '%3C%2Fb%3E'
         93        ECHO                                                     ~49
   44    94      > JMP                                                      ->96
   46    95*       RETURN                                                   null
   49    96    >   ECHO                                                     '%3C%2Ffieldset%3E%3C%2Fform%3E'
   51    97        ECHO                                                     '%3Cform+action%3D%22%22+method%3D%22post%22%3E'
   52    98        ECHO                                                     '%3Cfieldset%3E'
   53    99        ECHO                                                     '%3Clegend%3E%D0%9A%D0%B0%D0%BB%D1%8C%D0%BA%D1%83%D0%BB%D1%8F%D1%82%D0%BE%D1%80+%28%D1%81+%D0%B8%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5%D0%BC+2-%D1%85+%D1%87%D0%B8%D1%81%D0%B5%D0%BB%29%3C%2Flegend%3E'
   54   100        ECHO                                                     '%3Cinput+type%3D%22text%22+name%3D%22a%22+size%3D%228%22+%2F%3E'
   55   101        ECHO                                                     '%3Cselect+name%3D%22q%22%3E'
   56   102        ECHO                                                     '%3Coption+value%3D%22no%22%3E+%3C%2Foption%3E'
   57   103        ECHO                                                     '%3Coption+value%3D%22add%22%3E%2B%3C%2Foption%3E'
   58   104        ECHO                                                     '%3Coption+value%3D%22min%22%3E-%3C%2Foption%3E'
   59   105        ECHO                                                     '%3Coption+value%3D%22um%22%3E%2A%3C%2Foption%3E'
   60   106        ECHO                                                     '%3Coption+value%3D%22pod%22%3E%26%23247%3B%3C%2Foption%3E'
   61   107        ECHO                                                     '%3C%2Fselect%3E'
   62   108        ECHO                                                     '%3Cinput+type%3D%22text%22+name%3D%22b%22+size%3D%228%22+%2F%3E'
   63   109        ECHO                                                     '%3Cinput+type%3D%22submit%22+value%3D%22%3D%22+%2F%3E'
   65   110        FETCH_R                      global              ~53     '_POST'
        111        FETCH_DIM_R                                      ~54     ~53, 'a'
        112        ASSIGN                                                   !7, ~54
   66   113        FETCH_R                      global              ~56     '_POST'
        114        FETCH_DIM_R                                      ~57     ~56, 'b'
        115        ASSIGN                                                   !8, ~57
   67   116        FETCH_R                      global              ~59     '_POST'
        117        FETCH_DIM_R                                      ~60     ~59, 'q'
        118        ASSIGN                                                   !9, ~60
   68   119        FETCH_IS                                         ~62     '_POST'
        120        ISSET_ISEMPTY_DIM_OBJ                         0  ~63     ~62, 'a'
        121      > JMPZ_EX                                          ~63     ~63, ->125
        122    >   FETCH_IS                                         ~64     '_POST'
        123        ISSET_ISEMPTY_DIM_OBJ                         0  ~65     ~64, 'b'
        124        BOOL                                             ~63     ~65
        125    > > JMPZ                                                     ~63, ->188
   70   126    > > SWITCH_STRING                                            !9, [ 'no':->138, 'add':->140, 'min':->150, 'um':->160, 'pod':->170, ], ->187
   72   127    >   IS_EQUAL                                                 !9, 'no'
        128      > JMPNZ                                                    ~66, ->138
   76   129    >   IS_EQUAL                                                 !9, 'add'
        130      > JMPNZ                                                    ~66, ->140
   80   131    >   IS_EQUAL                                                 !9, 'min'
        132      > JMPNZ                                                    ~66, ->150
   84   133    >   IS_EQUAL                                                 !9, 'um'
        134      > JMPNZ                                                    ~66, ->160
   88   135    >   IS_EQUAL                                                 !9, 'pod'
        136      > JMPNZ                                                    ~66, ->170
        137    > > JMP                                                      ->187
   73   138    >   ECHO                                                     '%D0%92%D0%B8%D0%B1%D0%B5%D1%80%D0%B8%D1%82%D0%B5+%D0%B4%D0%B5%D0%B9%D1%81%D1%82%D0%B2%D0%B8%D0%B5%21'
   74   139      > JMP                                                      ->187
   77   140    >   ADD                                              ~67     !7, !8
        141        ASSIGN                                                   !10, ~67
   78   142        ROPE_INIT                                     6  ~70     !7
        143        ROPE_ADD                                      1  ~70     ~70, '+%2B+'
        144        ROPE_ADD                                      2  ~70     ~70, !8
        145        ROPE_ADD                                      3  ~70     ~70, '+%3D+%3Cb%3E'
        146        ROPE_ADD                                      4  ~70     ~70, !10
        147        ROPE_END                                      5  ~69     ~70, '%3C%2Fb%3E'
        148        ECHO                                                     ~69
   79   149      > JMP                                                      ->187
   81   150    >   SUB                                              ~73     !7, !8
        151        ASSIGN                                                   !11, ~73
   82   152        ROPE_INIT                                     6  ~76     !7
        153        ROPE_ADD                                      1  ~76     ~76, '+-+'
        154        ROPE_ADD                                      2  ~76     ~76, !8
        155        ROPE_ADD                                      3  ~76     ~76, '+%3D+%3Cb%3E'
        156        ROPE_ADD                                      4  ~76     ~76, !11
        157        ROPE_END                                      5  ~75     ~76, '%3C%2Fb%3E'
        158        ECHO                                                     ~75
   83   159      > JMP                                                      ->187
   85   160    >   MUL                                              ~79     !7, !8
        161        ASSIGN                                                   !12, ~79
   86   162        ROPE_INIT                                     6  ~82     !7
        163        ROPE_ADD                                      1  ~82     ~82, '+%2A+'
        164        ROPE_ADD                                      2  ~82     ~82, !8
        165        ROPE_ADD                                      3  ~82     ~82, '+%3D+%3Cb%3E'
        166        ROPE_ADD                                      4  ~82     ~82, !12
        167        ROPE_END                                      5  ~81     ~82, '%3C%2Fb%3E'
        168        ECHO                                                     ~81
   87   169      > JMP                                                      ->187
   89   170    >   IS_EQUAL                                         ~85     !8, ''
        171      > JMPNZ_EX                                         ~85     ~85, ->174
        172    >   IS_EQUAL                                         ~86     !8, 0
        173        BOOL                                             ~85     ~86
        174    > > JMPZ                                                     ~85, ->177
   91   175    >   ECHO                                                     '%D0%94%D0%B5%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5+%D0%BD%D0%B0+0+%D0%BD%D0%B5+%D0%B2%D0%BE%D0%B7%D0%BC%D0%BE%D0%B6%D0%BD%D0%BE%21+%3Cbr%3E'
        176      > JMP                                                      ->186
   95   177    >   DIV                                              ~87     !7, !8
        178        ASSIGN                                                   !13, ~87
   96   179        ROPE_INIT                                     6  ~90     !7
        180        ROPE_ADD                                      1  ~90     ~90, '+%2F+'
        181        ROPE_ADD                                      2  ~90     ~90, !8
        182        ROPE_ADD                                      3  ~90     ~90, '+%3D+%3Cb%3E'
        183        ROPE_ADD                                      4  ~90     ~90, !13
        184        ROPE_END                                      5  ~89     ~90, '%3C%2Fb%3E'
        185        ECHO                                                     ~89
   98   186    > > JMP                                                      ->187
  100   187    > > RETURN                                                   null
  102   188    >   ECHO                                                     '%3C%2Ffieldset%3E%3C%2Fform%3E'
  103   189      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.94 ms | 1416 KiB | 21 Q