title: how to hide properties of class during serialization?
body: <p>can i override function that is responsbile for serializing and Php class to an array/stdclass so that i can implement my own logic "like hiding certain attributes based on condition)</p>
  
  <pre><code>class UserModel{
    $hidden = ['password'];
  
    function __construct(array $data) {
      foreach($data as $key=&gt;$value)$this-&gt;$key = $value;
    }
  
  }
  
  $user = new UserModel(['id'=&gt;1,'password'=&gt;123]);
  
  var_dump($user);
  </code></pre>