3v4l.org

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

preferences:
37.82 ms | 402 KiB | 5 Q