Get and set (private) property in PHP as in C# without using getter setter magic method overloading.
## Summary ##

Code sample:

    Class People {
        // private property.
        private $name;

        // other methods not shown for simplicity.
    }

Straight forward. Let me assume that `$name` is a **PRIVATE** class member *(or property, variable, field, call it as you wish)*. Is there any way to do these in PHP:

    $someone = new People();
    $someone->name = $value;
    $somevar = $someone->name;

**WITHOUT** using `__get($name)` and `__set($name, $value)`.


----------


## Background ##
I needed to check the assigned `$value`, therefore I simply need a getter setter like this:

    getName();
    setName($value);

And **NOT** necessarily a getter setter magic method overloading like this:

    __get($value); 
    __set($value, $name);

That said, I simply need a getter setter. But that's **NOT** what I want. It just doesn't feel like object oriented, for people from static typed language such as C++ or C# might feel the same way as I do. 

*Is there any way to get and set a private property in PHP as in C# without using getter setter magic method overloading?*
Get and set (private) property in PHP as in C# without using getter setter magic method overloading.
===

## Summary ##

Code sample:

    Class People {
        // private property.
        private $name;

        // other methods not shown for simplicity.
    }

Straight forward. Let me assume that `$name` is a **PRIVATE** class member *(or property, variable, field, call it as you wish)*. Is there any way to do these in PHP:

    $someone = new People();
    $someone->name = $value;
    $somevar = $someone->name;

**WITHOUT** using `__get($name)` and `__set($name, $value)`.


----------


## Background ##
I needed to check the assigned `$value`, therefore I simply need a getter setter like this:

    getName();
    setName($value);

And **NOT** necessarily a getter setter magic method overloading like this:

    __get($value); 
    __set($value, $name);

That said, I simply need a getter setter. But that's **NOT** what I want. It just doesn't feel like object oriented, for people from static typed language such as C++ or C# might feel the same way as I do. 

*Is there any way to get and set a private property in PHP as in C# without using getter setter magic method overloading?*