6 Replies Latest reply: Nov 30, 2010 11:12 PM by hidarikani RSS

    Getters that return a reference to an Array

    hidarikani Community Member

      This code exposes private variables to modifications outside the class:

       

      public function get myArr():Array {
           return _myPrivateArr;
      }
      

       

      Does this mean getters should clone arrays before returning them?