3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $id; public function __construct() { $id = $used++; } public function getId() { return $id; } } $a = new Foo; // $a is a pointer pointing to Foo object 0 $b = $a; // $b is a pointer pointing to Foo object 0, however, $b is a copy of $a unlink($a); var_dump($b);

preferences:
33.77 ms | 402 KiB | 5 Q