3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* assuming: <form action='admin.php' name='value' method='POST'> <input type="radio" name="option" value="employee" checked> View Customers<br> <input type="radio" name="option" value="upload"> Upload File<br> <input type="radio" name="option" value="editUser"> Edit Access<br> <input type="submit" name="submit" value="Enter" class="button" /> </form> */ //just simulating $_POST['option'] = 'employee'; function redirect_to ($to){ echo $to; } //code: $redirectsAllowed = ['employee', 'upload', 'editUser']; if(isset($_POST['option']) && in_array($_POST['option'],$redirectsAllowed,true)){ redirect_to ($_POST['option'] . '.php'); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Branch analysis from position: 15
filename:       /in/3XIv4
function name:  (null)
number of ops:  23
compiled vars:  !0 = $redirectsAllowed
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_W                      global              $1      '_POST'
          1        ASSIGN_DIM                                               $1, 'option'
          2        OP_DATA                                                  'employee'
   19     3        ASSIGN                                                   !0, <array>
   21     4        FETCH_IS                                         ~4      '_POST'
          5        ISSET_ISEMPTY_DIM_OBJ                         0  ~5      ~4, 'option'
          6      > JMPZ_EX                                          ~5      ~5, ->15
          7    >   INIT_FCALL                                               'in_array'
          8        FETCH_R                      global              ~6      '_POST'
          9        FETCH_DIM_R                                      ~7      ~6, 'option'
         10        SEND_VAL                                                 ~7
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $8      
         14        BOOL                                             ~5      $8
         15    > > JMPZ                                                     ~5, ->22
   22    16    >   INIT_FCALL                                               'redirect_to'
         17        FETCH_R                      global              ~9      '_POST'
         18        FETCH_DIM_R                                      ~10     ~9, 'option'
         19        CONCAT                                           ~11     ~10, '.php'
         20        SEND_VAL                                                 ~11
         21        DO_FCALL                                      0          
   23    22    > > RETURN                                                   1

Function redirect_to:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3XIv4
function name:  redirect_to
number of ops:  3
compiled vars:  !0 = $to
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        ECHO                                                     !0
   16     2      > RETURN                                                   null

End of function redirect_to

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.18 ms | 1399 KiB | 16 Q