3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Obj { public $num; public function __construct($num) { $this->num = $num; } } $arr = array(new Obj(1),new Obj(2),new Obj(3)); var_dump($arr); $arr = array_diff($arr,array(new Obj(2))); var_dump($arr);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> object(Obj)#1 (1) { ["num"]=> int(1) } [1]=> object(Obj)#2 (1) { ["num"]=> int(2) } [2]=> object(Obj)#3 (1) { ["num"]=> int(3) } } Fatal error: Uncaught Error: Object of class Obj could not be converted to string in /in/pSLC4:12 Stack trace: #0 /in/pSLC4(12): array_diff(Array, Array) #1 {main} thrown in /in/pSLC4 on line 12
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:
33.82 ms | 401 KiB | 8 Q