Created
July 9, 2017 16:57
-
-
Save myanmarlinks/9bfe0597d6dab7cf221e42ea8d4ff065 to your computer and use it in GitHub Desktop.
PHP Magic Methods Program (4)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
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"); | |
$dog->bark(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment