title: php when to use array as a parameter/property
body: <p>For the following two classes:</p>
  
  <p>should I use array as a parameter or one by one?</p>
  
  <pre><code>class image {
  
      public function __construct(array $color, array $padding) {
          ...
      }
  }
  
  class image {
  
      public function __construct($red, $green, $blue, $paddingtop, $paddingright, $paddingbottom, $paddingleft) {
          ...
      }
  }
  </code></pre>
  
  <p>Also for class properties:</p>
  
  <pre><code>class image {
      protected $paddingtop;
  
      protected $paddingright;
  
      protected $paddingbottom;
  
      protected $paddingleft;
  
      protected $colorred;
  
      protected $colorgreen;
  
      protected $colorblue;
  }
  
  class image {
  
      protected $padding = array('top' =&gt; ..., 'right' =&gt; ..., 'bottom' =&gt; ..., 'left' =&gt; ...);
  
      protected $color = array('red' =&gt; ..., 'green' =&gt; ..., 'blue' =&gt; ...);
  
  }
  </code></pre>
  
  <p>Is it better to treat them as an array or a single variable?</p>
  
  <p>Maybe this question don't have a fixed answer, but I'm just a php beginner and don't have any work experience, I wanna hear your suggestion which way is the most common use or easy for other coders to read.</p>
  
  <p>Thanks!</p>