3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected $i = 0; public function __toString() { echo "i => {$this->i}\n"; $this->i++; return "$this->i"; } } $a = new A; echo $a; $b = ['100', $a]; var_dump(array_intersect($b, $b));

preferences:
57.87 ms | 402 KiB | 5 Q