3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array("abc\0def" => "abc\0def"); $obj = (object)$arr; print_r($arr); echo "\n"; var_dump($obj); echo "\n"; echo serialize($obj); echo "\n"; echo (int)property_exists($obj, "abc"); echo "\n"; echo (int)isset($obj->{"abc"}); echo "\n"; echo json_encode($obj); echo "\n"; var_dump((array)$obj); echo "\n"; var_export($obj); echo "\n"; print_r($obj); echo "\n"; debug_zval_dump($obj); echo "\n"; var_dump(get_object_vars($obj)); echo "\n"; $b = get_object_vars($obj); echo $b["abc"]; echo "\n"; foreach ($obj as $key=>$val) { echo $key." : ".$val."\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [abcdef] => abcdef ) object(stdClass)#1 (1) { ["abcdef"]=> string(7) "abcdef" } O:8:"stdClass":1:{s:7:"abcdef";s:7:"abcdef";} 0 0 {"abc\u0000def":"abc\u0000def"} array(1) { ["abcdef"]=> string(7) "abcdef" } (object) array( 'abcdef' => 'abc' . "\0" . 'def', ) stdClass Object ( [abcdef] => abcdef ) object(stdClass)#1 (1) refcount(2){ ["abc"]=> string(7) "abcdef" refcount(1) } array(1) { ["abcdef"]=> string(7) "abcdef" } Warning: Undefined array key "abc" in /in/qKQD2 on line 29 abcdef : abcdef

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