return isset($this->data[$name]); } function __unset($name) { unset($this->data[$name]); echo "unset<br>"; } function __call($methodName, $args) { echo "You try to call {$methodName} <br>"; print_r($args); echo $args[5]->sayName(); } } $first = new People('putin'); $first->sayName(); $obj = new Girl('Алина'); $obj->sayName(); $obj->putin(1, 2, 3, 5, 5, new People("hello")); //echo ($obj); //echo obj(); //unset($obj); //echo "<br>hello<br>"; // //$obj->age = 33; //$obj->weight = 90; //echo '<pre>'; //var_dump($obj); //echo'<br>'; // //if (isset($obj->age)){
function foo(People $obj) { $obj->sayName(); $obj->eat(); }
echo "<br>{$words}"; } else { echo "<br>Путин хамло"; } } function sayName() { if ($this->name == "Владимир") { echo "<br> Хамло"; } else { echo "<br>" . $this->name; } } static function noice() { echo "<br>la-la-la"; } } $obj = new People(); $obj->name = "Владимир"; $obj->lname = "Путин"; /*echo "Имя обьекта = " . $obj ->name."<br>Фамилия обьекта = " . $obj ->lname; $obj ->say('Привет хамло'); $obj ->say();*/ $obj->sayName(); People::noice(); $dima = new people(); $dima->name = "Дмитрий"; $dima->lname = "Медведев"; $dima->sayName(); People::noice();