title: Instantiation of new object or reusing the same one for storing data
body: <p>I have the following PHP class called <code>Customer</code> with function <code>create()</code> which stores customer's data into database:</p>
  <pre><code>class Customer
  {
    public $createdby;
    public $cname;
  
    public function create()
    {
      ...
    }
  }
  </code></pre>
  <p>Since I need to store more customers in a loop where only name (<code>$cname</code> variable) changes (for the sake of simplicity here the <code>$createdby</code> variable is the same for all created customers within this loop - because the same user created all <code>Customers</code>), the question rises - what is (and why) the better practice;</p>
  <p><strong>method A</strong>) reusing the same Customer object where one changes only properties which are changed:</p>
  <pre><code>$Customer=new Customer();
  $Customer-&gt;createdby='somebody';
  foreach($cnames as $cname)
  {
    $Customer-&gt;cname=$cname;
    $Customer-&gt;create();
  }
  </code></pre>
  <p><strong>method B</strong>) instatiating new Customer object and setting all properties for each particular creation like:</p>
  <pre><code>foreach($cnames as $cname)
  {
    $Customer=new Customer();
    $Customer-&gt;createdby='somebody';
    $Customer-&gt;cname=$cname;
    $Customer-&gt;create();
  }
  </code></pre>
  <p>If I'd like to make an array of Customer objects, for sure, I would have to use second method. But here's not that case. I don't see any drawback of first principle with reusing the existing object for storing more customers into database but maybe I'm wrong. So I ask just in case what is better practice and why!</p>