3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Add the core functions. */ function apply_filters( $hook_name, $value ) { return $value; } function wp_parse_str( $string, &$array ) { parse_str( $string, $array ); /** * Filters the array of variables derived from a parsed string. * * @since 2.3.0 * * @param array $array The array populated with variables. */ $array = apply_filters( 'wp_parse_str', $array ); } function wp_parse_args( $args, $defaults = array() ) { if ( is_object( $args ) ) { $parsed_args = get_object_vars( $args ); } elseif ( is_array( $args ) ) { $parsed_args =& $args; } else { wp_parse_str( $args, $parsed_args ); } if ( is_array( $defaults ) && $defaults ) { return array_merge( $defaults, $parsed_args ); } return $parsed_args; } /** * Run the sample code to validate what happens when $args is null. */ $args = null; $defaults = array( 'foo' => 'bar' ); $args = wp_parse_args( $args, $defaults ); var_dump( $args ); // array(1) { ["foo"]=> string(3) "bar" }
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: parse_str(): Passing null to parameter #1 ($string) of type string is deprecated in /in/P9tVH on line 12 array(1) { ["foo"]=> string(3) "bar" }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
62.26 ms | 401 KiB | 8 Q