3v4l.org

run code in 300+ PHP versions simultaneously
<?php $queryString = '/post.php?foo=5&bar=&baz=2&bee=&fee=&feo=8'; $queryUrl = parse_url($queryString); //path, query parse_str($queryUrl['query'], $args); $args = array_filter($args); $queryString = $queryUrl['path'].(count($args) ?'?'.http_build_query($args) :''); var_dump($queryString);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 23
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7hFm4
function name:  (null)
number of ops:  30
compiled vars:  !0 = $queryString, !1 = $queryUrl, !2 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2Fpost.php%3Ffoo%3D5%26bar%3D%26baz%3D2%26bee%3D%26fee%3D%26feo%3D8'
    4     1        INIT_FCALL                                               'parse_url'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
    5     5        INIT_FCALL                                               'parse_str'
          6        FETCH_DIM_R                                      ~6      !1, 'query'
          7        SEND_VAL                                                 ~6
          8        SEND_REF                                                 !2
          9        DO_ICALL                                                 
    6    10        INIT_FCALL                                               'array_filter'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !2, $8
    7    14        FETCH_DIM_R                                      ~10     !1, 'path'
         15        COUNT                                            ~11     !2
         16      > JMPZ                                                     ~11, ->23
    8    17    >   INIT_FCALL                                               'http_build_query'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $12     
         20        CONCAT                                           ~13     '%3F', $12
         21        QM_ASSIGN                                        ~14     ~13
         22      > JMP                                                      ->24
    9    23    >   QM_ASSIGN                                        ~14     ''
         24    >   CONCAT                                           ~15     ~10, ~14
    7    25        ASSIGN                                                   !0, ~15
   10    26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.03 ms | 941 KiB | 24 Q