$name = "John"; $isModified = isModified($name); if($isModified == true){ //variable has been modified since last access } else { //variable has not been modified since last access }
class Person { public $name; public $age; public function __construct($name, $age){ $this->name = $name; $this->age = $age; } public function setName($name){ $this->name = $name; } } $person = new Person("John", 30); $isModified = isModified($person); //changing object properties $person->setName("Bob"); if($isModified == true){ //object has been modified since last access } else { //object has not been modified since last access }This method is not part of any specific package library as it is a built-in function in PHP.