3v4l.org

run code in 300+ PHP versions simultaneously
<?php function uri_to_array($uri){ $result = array(); var_dump(strpos($uri, '?')); if ($pos = strpos($uri, '?') !== false) { $pos++; } else { $pos = 0; } parse_str(substr($uri, (int) $pos), $result); return $result; } print_r( uri_to_array('asd?sub_page=products&action[]=add&action[]=remove') );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MBY93
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'print_r'
   15     1        INIT_FCALL                                               'uri_to_array'
          2        SEND_VAL                                                 'asd%3Fsub_page%3Dproducts%26action%5B%5D%3Dadd%26action%5B%5D%3Dremove'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   16     6      > RETURN                                                   1

Function uri_to_array:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MBY93
function name:  uri_to_array
number of ops:  30
compiled vars:  !0 = $uri, !1 = $result, !2 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, <array>
    4     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'strpos'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 '%3F'
          6        DO_ICALL                                         $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
    5     9        INIT_FCALL                                               'strpos'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 '%3F'
         12        DO_ICALL                                         $6      
         13        TYPE_CHECK                                  1018  ~7      $6
         14        ASSIGN                                           ~8      !2, ~7
         15      > JMPZ                                                     ~8, ->18
    6    16    >   PRE_INC                                                  !2
         17      > JMP                                                      ->19
    8    18    >   ASSIGN                                                   !2, 0
   10    19    >   INIT_FCALL                                               'parse_str'
         20        INIT_FCALL                                               'substr'
         21        SEND_VAR                                                 !0
         22        CAST                                          4  ~11     !2
         23        SEND_VAL                                                 ~11
         24        DO_ICALL                                         $12     
         25        SEND_VAR                                                 $12
         26        SEND_REF                                                 !1
         27        DO_ICALL                                                 
   11    28      > RETURN                                                   !1
   12    29*     > RETURN                                                   null

End of function uri_to_array

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.71 ms | 1403 KiB | 24 Q