3v4l.org

run code in 300+ PHP versions simultaneously
<?php $desc = '{"a":1, "b":2}'; $ob = '{"a":1, "b":2, "c":3}'; function isLikeThis(string $description, string $tested) { $args = func_get_args(); $assocArrayArgs = array_map(function($arg){ get_object_vars(json_decode($arg)); }, $args ); var_dump($args); return !(bool)call_user_func_array('array_diff_assoc', $args); } var_dump(isLikeThis($desc, $ob));
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> string(14) "{"a":1, "b":2}" [1]=> string(21) "{"a":1, "b":2, "c":3}" } Fatal error: Uncaught TypeError: array_diff_assoc(): Argument #1 ($array) must be of type array, string given in /in/6i6Yg:13 Stack trace: #0 /in/6i6Yg(13): array_diff_assoc('{"a":1, "b":2}', '{"a":1, "b":2, ...') #1 /in/6i6Yg(15): isLikeThis('{"a":1, "b":2}', '{"a":1, "b":2, ...') #2 {main} thrown in /in/6i6Yg on line 13
Process exited with code 255.

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