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

    Getters that return a reference to an Array

    hidarikani Level 2

      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?