3v4l.org

run code in 300+ PHP versions simultaneously
<?php class WP_Error extends stdClass {} $empty_array = array(); $array = array( 'cat1', 'cat2', 'cat3', 'cat1' ); $error = new WP_Error(); var_dump(array_unique($empty_array)); var_dump(array_unique($array)); var_dump(array_unique($error)); // This is the problem case.
Output for git.master, git.master_jit, rfc.property-hooks
array(0) { } array(3) { [0]=> string(4) "cat1" [1]=> string(4) "cat2" [2]=> string(4) "cat3" } Fatal error: Uncaught TypeError: array_unique(): Argument #1 ($array) must be of type array, WP_Error given in /in/vUnPH:11 Stack trace: #0 /in/vUnPH(11): array_unique(Object(WP_Error)) #1 {main} thrown in /in/vUnPH on line 11
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:
120.79 ms | 406 KiB | 5 Q