/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php class Person { private $firstName; private $lastName; private $age; private $country; function __call($method, $arguments) { return; } return $this->$property; } if ($prefix == "set") { $this->$property = $arguments[0]; } } } $personObj = new Person; $personObj->setFirstName("Pepe"); $personObj->setLastName("Argento"); $personObj->setAge(50); $personObj->setCountry("Argentina"); echo "Nombre: ".$personObj->getFirstName()." ".$personObj->getLastName()."\n"; echo "Edad: ".$personObj->getAge()."\n"; echo "PaÃs: ".$personObj->getCountry()."\n"; ?>