3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parse_qs($data) { $data = preg_replace_callback('/(?:^|(?<=&))[^=[]+/', function($match) { return bin2hex(urldecode($match[0])); }, $data); parse_str($data, $values); return array_combine(array_map('hex2bin', array_keys($values)), $values); } $query = 'foo bar=baz'; var_dump(parse_qs($query));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0iW7m
function name:  (null)
number of ops:  8
compiled vars:  !0 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, 'foo+bar%3Dbaz'
   15     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'parse_qs'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function parse_qs:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0iW7m
function name:  parse_qs
number of ops:  25
compiled vars:  !0 = $data, !1 = $values
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%2F%28%3F%3A%5E%7C%28%3F%3C%3D%26%29%29%5B%5E%3D%5B%5D%2B%2F'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F0iW7m%3A5%240'
    7     4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
    5     7        ASSIGN                                                   !0, $3
    9     8        INIT_FCALL                                               'parse_str'
          9        SEND_VAR                                                 !0
         10        SEND_REF                                                 !1
         11        DO_ICALL                                                 
   11    12        INIT_FCALL                                               'array_combine'
         13        INIT_FCALL                                               'array_map'
         14        SEND_VAL                                                 'hex2bin'
         15        INIT_FCALL                                               'array_keys'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $6      
         18        SEND_VAR                                                 $6
         19        DO_ICALL                                         $7      
         20        SEND_VAR                                                 $7
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $8      
         23      > RETURN                                                   $8
   12    24*     > RETURN                                                   null

End of function parse_qs

Function %00%7Bclosure%7D%2Fin%2F0iW7m%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0iW7m
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'bin2hex'
          2        INIT_FCALL                                               'urldecode'
          3        FETCH_DIM_R                                      ~1      !0, 0
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                         $3      
          8      > RETURN                                                   $3
    7     9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F0iW7m%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.83 ms | 1403 KiB | 30 Q