3v4l.org

run code in 300+ PHP versions simultaneously
<?php $convert_html_keys = array("name", "label", "html", "options" => array("text")); $object = json_decode(json_encode(array( "options" => array( 0 => json_decode(json_encode(array( "value" => 0, "text" => "wtf0000" ))), 1 => json_decode(json_encode(array( "value" => 1, "text" => "wtf1111" ))) ) ))); foreach ($convert_html_keys as $key => $val) { foreach ($val as $option_array_value) { foreach ($object->$key as &$object_key_value) { $object_key_value->text = "omg"; } } } print_r($object);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: foreach() argument must be of type array|object, string given in /in/roZhp on line 18 Warning: foreach() argument must be of type array|object, string given in /in/roZhp on line 18 Warning: foreach() argument must be of type array|object, string given in /in/roZhp on line 18 stdClass Object ( [options] => Array ( [0] => stdClass Object ( [value] => 0 [text] => omg ) [1] => stdClass Object ( [value] => 1 [text] => omg ) ) )

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