rfc:parse_str_alternative

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
rfc:parse_str_alternative [2021/08/05 22:18] – Implemenation ready dharmanrfc:parse_str_alternative [2021/08/06 19:26] – Change to http_parse_query dharman
Line 1: Line 1:
-====== PHP RFC: Add parse_query_string as an alternative to parse_str ======+====== PHP RFC: Add http_parse_query as an alternative to parse_str ======
   * Date: 2021-06-23   * Date: 2021-06-23
   * Author: Kamil Tekiela <dharman@php.net>   * Author: Kamil Tekiela <dharman@php.net>
   * Status: Discussion   * Status: Discussion
   * Implementation: https://github.com/php/php-src/pull/7344   * Implementation: https://github.com/php/php-src/pull/7344
-  * Target Version: PHP 8.1+  * Target Version: PHP 8.2
  
 ===== Introduction ===== ===== Introduction =====
Line 22: Line 22:
 ===== Proposal ===== ===== Proposal =====
  
-The proposal is to create a new function as a copy of %%parse_str()%% but change the name to %%parse_query_string()%% and return the array instead of using the out parameter. The new function will take only one argument.+The proposal is to create a new function as a copy of %%parse_str()%% but change the name to %%http_parse_query()%% and return the array instead of using the out parameter. The new function will take only one argument.
  
 The new function will also be maintained in the manual under https://www.php.net/manual/en/ref.url.php instead of https://www.php.net/manual/en/ref.strings.php The new function will also be maintained in the manual under https://www.php.net/manual/en/ref.url.php instead of https://www.php.net/manual/en/ref.strings.php
Line 29: Line 29:
 $str = "first=value&arr[]=foo+bar&arr[]=baz"; $str = "first=value&arr[]=foo+bar&arr[]=baz";
  
-$output = parse_query_string($str);+$output = http_parse_query($str);
 echo $output['first'];  // value echo $output['first'];  // value
 echo $output['arr'][0]; // foo bar echo $output['arr'][0]; // foo bar
Line 48: Line 48:
  
  
-<doodle title="Add new parse_query_string() function?" auth="dharman" voteType="single" closed="true"> +<doodle title="Add new http_parse_query() function?" auth="dharman" voteType="single" closed="true"> 
    * Yes    * Yes
    * No    * No
rfc/parse_str_alternative.txt · Last modified: 2022/05/21 14:03 by dharman