title: Array as class property?
body: <p>I have this API that requires me to have a specific array key to be send.
  Since that array needs to be used on ALL class methods, I was thinking on putting as a class property.</p>
  
  <pre><code>abstract class something {
      protected $_conexion;
      protected $_myArray = array();
  }
  </code></pre>
  
  <p>Later on, on the methods of this class, I will then use:</p>
  
  <pre><code>$this-&gt;_myArray["action"] = "somestring";
  </code></pre>
  
  <p>(Where "action" is the key that needs to be send to this API);</p>
  
  <p>Is this ok? I've not seen enough OOP in front of my eyes that's why I'm asking this.</p>
  
  <p>As requested, here is more info about the API:</p>
  
  <pre><code>class Apiconnect {
      const URL = 'https://someurl.com/api.php';
      const USERNAME = 'user';
      const PASSWORD = 'pass';
  
      /**
       *
       * @param &lt;array&gt; $postFields
       * @return SimpleXMLElement
       * @desc this connects but also sends and retrieves the information returned in XML
       */
      public function Apiconnect($postFields)
      {
          $postFields["username"] = self::USERNAME;
          $postFields["password"] = md5(self::PASSWORD);
          $postFields["responsetype"] = 'xml';
  
          $ch = curl_init();
          curl_setopt($ch, CURLOPT_URL, self::URL);
          curl_setopt($ch, CURLOPT_POST, 1);
          curl_setopt($ch, CURLOPT_TIMEOUT, 100);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
          curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
          $data = curl_exec($ch);
          curl_close($ch);
  
          $data = utf8_encode($data);
          $xml = new SimpleXMLElement($data);
  
          if($xml-&gt;result == "success")
          {
              return $xml;
          }
          else
          {  
              return $xml-&gt;message;
          }
      }
  
  }
  
  
  abstract class ApiSomething
  {
      protected $_connection;
      protected $_postFields = array();
  
      /**
       * @desc - Composition.
       */
      public function __construct()
      {
          require_once("apiconnect.php");
  
          $this-&gt;_connection = new Apiconnect($this-&gt;_postFields);
      }
  
      public function getPaymentMethods()
      {
          //this is the necessary field that needs to be send. Containing the action that the API should perform.
          $this-&gt;_postFields["action"] = "dosomething";
  
          //not sure what to code here;
  
          if($apiReply-&gt;result == "success")
          {
              //works the returned XML
              foreach ($apiReply-&gt;paymentmethods-&gt;paymentmethod as $method)
              {
                  $method['module'][] = $method-&gt;module;
                  $method['nome'][] = $method-&gt;displayname;
              }
  
              return $method;
          } 
      }
  }
  </code></pre>
  
  <p>Thanks a lot,
  MEM</p>