3v4l.org

run code in 300+ PHP versions simultaneously
<?php $filter = array( "grant_type" => array("filter" => FILTER_VALIDATE_REGEXP, "options" => array("regexp" => "/^(authorization_code|password|assertion|refresh_token|none)$/"), "flags" => FILTER_REQUIRE_SCALAR), "scope" => array("flags" => FILTER_REQUIRE_SCALAR), "code" => array("flags" => FILTER_REQUIRE_SCALAR), "redirect_uri" => array("filter" => FILTER_SANITIZE_URL), "username" => array("flags" => FILTER_REQUIRE_SCALAR), "password" => array("flags" => FILTER_REQUIRE_SCALAR), "assertion_type" => array("flags" => FILTER_REQUIRE_SCALAR), "assertion" => array("flags" => FILTER_REQUIRE_SCALAR), "refresh_token" => array("flags" => FILTER_REQUIRE_SCALAR), "user_id" => array("filter" => FILTER_VALIDATE_INT), ); $arResult["user_id"] = 1234; $arResult["client_id"] = $client_id; $arResult = filter_var_array($arResult, $filter); var_dump($arResult);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $client_id in /in/f10qf on line 16 array(10) { ["grant_type"]=> NULL ["scope"]=> NULL ["code"]=> NULL ["redirect_uri"]=> NULL ["username"]=> NULL ["password"]=> NULL ["assertion_type"]=> NULL ["assertion"]=> NULL ["refresh_token"]=> NULL ["user_id"]=> int(1234) }

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:
77.6 ms | 406 KiB | 5 Q