title: how can use multiple function in one instance class php
body: <p>need return data like this:</p>
  
  <pre><code>Person::firstname('ali')-&gt;lastname('hamrani')-&gt;age('19');
  </code></pre>
  
  <p>my code :</p>
  
  <pre><code>class Person {
      protected $firstname;
      protected $lastname;
      protected $age;
  
      public static function firstname($firstname)
      {
          $this-&gt;$firstname = $firstname;
      }
      public static function lastname($lastname)
      {
          $this-&gt;lastname = $lastname;
      }
  
      public static function age($age)
      {
          $this-&gt;age = $age;
      }
  
      public static function toArray()
      {
          return [
              'firstname' =&gt; $this-&gt;firstname,
              'lastname' =&gt; $this-&gt;lastname,
              'age' =&gt; $this-&gt;age
          ];
      }
  }
  
  print_r(Person::firstname('ali')-&gt;lastname('hamrani')-&gt;age(19)-&gt;toArray());
  </code></pre>
  
  <p>i need return for me like this:</p>
  
  <pre><code>[
    'firstName' =&gt; 'ali',
     'lastName' =&gt; 'hamrani',
     'age' =&gt; 19,
  ]
  </code></pre>