title: How to push duplicate entry in PHP?
body: <p>Following is an object:</p>
  
  <pre><code>$obj = (object) [];
  $obj-&gt;{'key1'} = 'val1';
  </code></pre>
  
  <p>Now, how do I push a key with same name but different value?</p>
  
  <pre><code>$obj = (object) [];
  $obj-&gt;{'key1'} = 'val1';
  $obj-&gt;{'key1'} = 'val2';
  </code></pre>
  
  <p>It just edits the <code>key1</code>. I know this is an expected behavior but do we have other workarounds?</p>
  
  <p>I want the schema to be like:</p>
  
  <pre><code>"collection": {
      "obj1": "val1",
      "obj1": "val2"
  }
  </code></pre>