3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_search_options($short_list_of_search = 1){ $return_string = "<option value=\"-1\">Any Text Field</option>"; $data = [1 => 'A']; foreach($data as $id => $user_frinedly_name){ // original code had this typo $return_string .= "<option value=\"". $id . "\">". $user_frinedly_name . "</option>"; } $return_string .= "<option value=\"50\">CPE</option>"; $return_string .= "<option value=\"100\">CVE</option>"; $return_string .= "<option value=\"150\">Minimum CVSS Score</option>"; $return_string .= "<option value=\"250\">CVE Summary Text</option>"; return $return_string; } ?> <script type="text/javascript"> function get_search_options(){ return <?php echo json_encode(get_search_options(1));?>;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KOFBF
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   ECHO                                                     '%3Cscript+type%3D%22text%2Fjavascript%22%3E%0Afunction+get_search_options%28%29%7B%0A%09return+'
   24     1        INIT_FCALL                                               'json_encode'
          2        INIT_FCALL                                               'get_search_options'
          3        SEND_VAL                                                 1
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                         $1      
          7        ECHO                                                     $1
          8        ECHO                                                     '%3B'
          9      > RETURN                                                   1

Function get_search_options:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/KOFBF
function name:  get_search_options
number of ops:  19
compiled vars:  !0 = $short_list_of_search, !1 = $return_string, !2 = $data, !3 = $user_frinedly_name, !4 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      1
    4     1        ASSIGN                                                   !1, '%3Coption+value%3D%22-1%22%3EAny+Text+Field%3C%2Foption%3E'
    7     2        ASSIGN                                                   !2, <array>
    9     3      > FE_RESET_R                                       $7      !2, ->12
          4    > > FE_FETCH_R                                       ~8      $7, !3, ->12
          5    >   ASSIGN                                                   !4, ~8
   10     6        CONCAT                                           ~10     '%3Coption+value%3D%22', !4
          7        CONCAT                                           ~11     ~10, '%22%3E'
          8        CONCAT                                           ~12     ~11, !3
          9        CONCAT                                           ~13     ~12, '%3C%2Foption%3E'
         10        ASSIGN_OP                                     8          !1, ~13
    9    11      > JMP                                                      ->4
         12    >   FE_FREE                                                  $7
   13    13        ASSIGN_OP                                     8          !1, '%3Coption+value%3D%2250%22%3ECPE%3C%2Foption%3E'
   14    14        ASSIGN_OP                                     8          !1, '%3Coption+value%3D%22100%22%3ECVE%3C%2Foption%3E'
   15    15        ASSIGN_OP                                     8          !1, '%3Coption+value%3D%22150%22%3EMinimum+CVSS+Score%3C%2Foption%3E'
   16    16        ASSIGN_OP                                     8          !1, '%3Coption+value%3D%22250%22%3ECVE+Summary+Text%3C%2Foption%3E'
   18    17      > RETURN                                                   !1
   19    18*     > RETURN                                                   null

End of function get_search_options

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.25 ms | 1390 KiB | 16 Q