3v4l.org

run code in 300+ PHP versions simultaneously
<?php function buildVirtualData($var) { if ( is_string($var) && null !== $json = json_decode($var, true) ) $var = $json; if ( is_array($var) ) return array_map('buildVirtualData', $var); return $var; } $_POST = array( "valor1" => 1200, "valor2" => "texto", "valor3" => true, "valor4" => '{"seclvl_text":"datp","seclvl_boolean":"false", "nestedJSONString":"{\"key\":\"value\"}"}', "valor5" => "true" ); var_dump(buildVirtualData($_POST));
Output for git.master, git.master_jit, rfc.property-hooks
array(5) { ["valor1"]=> int(1200) ["valor2"]=> string(5) "texto" ["valor3"]=> bool(true) ["valor4"]=> array(3) { ["seclvl_text"]=> string(4) "datp" ["seclvl_boolean"]=> bool(false) ["nestedJSONString"]=> array(1) { ["key"]=> string(5) "value" } } ["valor5"]=> bool(true) }

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:
63.53 ms | 402 KiB | 8 Q