3v4l.org

run code in 300+ PHP versions simultaneously
<?php $obj1 = (object) "hello1"; $obj1->gg = 'world1'; $obj2 = (object) "hello2"; $obj2->gg = 'world1'; $obj3 = (object) "hello3"; $obj3->gg = 'world3'; $arr = array(); $arr[0] = $obj1; $arr[1] = $obj2; $arr[2] = $obj3; $res = array_map("unserialize", array_unique(array_map("serialize", (array) $arr))); //$res = array_unique(array_map(function ((array) $arr) { return $arr['gg']; }, $holder)); print_r($res);

preferences:
39.62 ms | 402 KiB | 5 Q