class classname {
    private $attribute;

    function __get($name){
        return $this->$name;
    }
    function __set($name,$value){
        $this->$name = $value;
    }
}
$a = new classname();
$a->attribure = 5;
echo $a->attribure;

I pass only one parametr to __set and they are two parameters $name,$value and with __get I pass any parameter to $name.
I don't understand $a->attribute = 5, I suppose I pass the parameter to private $attribute but not pass any parameter to __set or __get

See your previous post asking this question.

    bertrc I pass only one parametr to __set

    You -- the programmer -- do not directly pass anything to the __set() "magic" method. The underlying program that interprets/runs your PHP code calls it for you whenever you try to set a non-public or undefined object property. That first parameter will contain the attribute name that was requested by the calling code, so that you can make decisions in the __set() method based on that name.

      Write a Reply...