- property_exists: documentation ( source)
- implode: documentation ( source)
<?php
class Vas{
private $auto;
public function __call($met, $ar)
{
echo 'no such func called '. $met .PHP_EOL;
echo 'argumentiruj ' . implode(', ', $ar);
}
public function aa($a)
{
$this->auto = $a;
echo $a . PHP_EOL;
}
public function __get($property)
{
if (property_exists($this, $property)) {
return $this->$property;
}
}
public function __set($property, $value) {
if (property_exists($this, $property)) {
$this->$property = $value;
return $this;
}
}
}
$ob = new Vas();
$ob->test();
$ob->aa('sss');
$res = $ob->auto;
echo $res;