3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new stdClass; $a->id = 2; $b = new stdClass; $b->id = 2; $case1 = array_unique([$a, $b], SORT_REGULAR); $storage = new SplObjectStorage(); $storage->attach($a); $storage->attach($b); $case2 = iterator_to_array($storage); var_dump($case1, $case2);

This is an error 500

Unexpected error `57014` from database


preferences:
5190.66 ms | 542 KiB | 5 Q