Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <?php
- Class Person {
- private $ime;
- private $familia;
- private $godini;
- function __construct($ime,$familia) {
- $this->ime=$ime;
- $this->familia=$familia;
- }
- function __destruct () {
- echo "<p>Сбогом живот в Интернет:( </p>";
- }
- function KazvamSe() {
- echo "<p>$this->ime $this->familia</p>";
- }
- function setGodini($godini){
- $this->godini=$godini;
- }
- function getGodini(){
- echo "<p>Аз съм на $this->godini години</p>" ;
- }
- }
- $peter = new Person("Петър","Иванов");
- $peter->KazvamSe();
- $peter->setGodini(31);
- $peter->getGodini();
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement