3v4l.org

run code in 500+ PHP versions simultaneously
<?php $result = []; $fetch_elements = ['property', 'price']; $_SERVER['QUERY_STRING'] = 'https://www.example.com?id=safety&order=1&price=0..995&property[172]=Canasafe'; parse_str(parse_url($_SERVER['QUERY_STRING'], PHP_URL_QUERY), $elements); foreach ($elements as $k=>$e) { if (in_array($k, $fetch_elements)) { $result[$k] = $e; } } // print_r($result); echo urldecode(http_build_query($result));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 23
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 23
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 22
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/RGSGN
function name:  (null)
number of ops:  32
compiled vars:  !0 = $result, !1 = $fetch_elements, !2 = $elements, !3 = $e, !4 = $k
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
    3     1        ASSIGN                                                       !1, <array>
    4     2        FETCH_W                          global              $7      '_SERVER'
          3        ASSIGN_DIM                                                   $7, 'QUERY_STRING'
          4        OP_DATA                                                      'https%3A%2F%2Fwww.example.com%3Fid%3Dsafety%26order%3D1%26price%3D0..995%26property%5B172%5D%3DCanasafe'
    6     5        INIT_FCALL                                                   'parse_str'
          6        INIT_FCALL                                                   'parse_url'
          7        FETCH_R                          global              ~9      '_SERVER'
          8        FETCH_DIM_R                                          ~10     ~9, 'QUERY_STRING'
          9        SEND_VAL                                                     ~10
         10        SEND_VAL                                                     6
         11        DO_ICALL                                             $11     
         12        SEND_VAR                                                     $11
         13        SEND_REF                                                     !2
         14        DO_ICALL                                                     
    8    15      > FE_RESET_R                                           $13     !2, ->23
         16    > > FE_FETCH_R                                           ~14     $13, !3, ->23
         17    >   ASSIGN                                                       !4, ~14
    9    18        FRAMELESS_ICALL_2                in_array            ~16     !4, !1
         19      > JMPZ                                                         ~16, ->22
   10    20    >   ASSIGN_DIM                                                   !0, !4
         21        OP_DATA                                                      !3
    8    22    > > JMP                                                          ->16
         23    >   FE_FREE                                                      $13
   15    24        INIT_FCALL                                                   'urldecode'
         25        INIT_FCALL                                                   'http_build_query'
         26        SEND_VAR                                                     !0
         27        DO_ICALL                                             $18     
         28        SEND_VAR                                                     $18
         29        DO_ICALL                                             $19     
         30        ECHO                                                         $19
         31      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
173.52 ms | 2039 KiB | 19 Q