3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'http://username:password@hostname/path?arg=value&key=value2#anchor'; $ss_url_args = parse_url($url); $ss_url_args = $ss_url_args['query']; $pieces = explode("&", $ss_url_args); for($i = 0; $i < count($pieces); $i++) { $args = explode("=", $pieces[$i]); if($args[0] === 'key') { $key = $args[1]; } } echo $key;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 14
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 14
Branch analysis from position: 29
Branch analysis from position: 14
Branch analysis from position: 25
filename:       /in/vF49R
function name:  (null)
number of ops:  31
compiled vars:  !0 = $url, !1 = $ss_url_args, !2 = $pieces, !3 = $i, !4 = $args, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fusername%3Apassword%40hostname%2Fpath%3Farg%3Dvalue%26key%3Dvalue2%23anchor'
    5     1        INIT_FCALL                                               'parse_url'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $7      
          4        ASSIGN                                                   !1, $7
    6     5        FETCH_DIM_R                                      ~9      !1, 'query'
          6        ASSIGN                                                   !1, ~9
    7     7        INIT_FCALL                                               'explode'
          8        SEND_VAL                                                 '%26'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $11     
         11        ASSIGN                                                   !2, $11
    8    12        ASSIGN                                                   !3, 0
         13      > JMP                                                      ->26
   10    14    >   INIT_FCALL                                               'explode'
         15        SEND_VAL                                                 '%3D'
         16        FETCH_DIM_R                                      ~14     !2, !3
         17        SEND_VAL                                                 ~14
         18        DO_ICALL                                         $15     
         19        ASSIGN                                                   !4, $15
   11    20        FETCH_DIM_R                                      ~17     !4, 0
         21        IS_IDENTICAL                                             ~17, 'key'
         22      > JMPZ                                                     ~18, ->25
   13    23    >   FETCH_DIM_R                                      ~19     !4, 1
         24        ASSIGN                                                   !5, ~19
    8    25    >   PRE_INC                                                  !3
         26    >   COUNT                                            ~22     !2
         27        IS_SMALLER                                               !3, ~22
         28      > JMPNZ                                                    ~23, ->14
   16    29    >   ECHO                                                     !5
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.29 ms | 1396 KiB | 17 Q