Skip to content

Instantly share code, notes, and snippets.

Created July 9, 2017 16:57
What would you like to do?
PHP Magic Methods Program (4)
class Dog {
private $name;
public function __construct($name) {
echo "object constructed! <br>";
$this->name = $name;
public function bark() {
echo "Bark! <br >";
public function __destruct() {
echo "object destructed! <br>";
$dog = new Dog("Arnold");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment