PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php class A { protected $x; public function __construct() { $this->reset(); } public function getX() { return $this->x; } public function reset() { $this->x = new \DateTimeImmutable(); } } $a = new A(); $test = $a->getX(); echo spl_object_hash($test) . "\n"; $a->reset(); echo spl_object_hash($test);
Show:  
Copy Clear