Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "J.O. Aho" Newsgroups: comp.lang.php Subject: Re: Loading globals into classes Date: Sun, 22 Jan 2012 21:09:51 +0100 Lines: 16 Message-ID: <9o38ofFagkU1@mid.individual.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net mp7EXslg3SWYP1K6V3TBMwMQgXT9zszeOS2oKQrNpHhmCXtMHV Cancel-Lock: sha1:ybyUO7VdRkF71FJDDX8dko9KRbo= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0.1) Gecko/20111226 Firefox/9.0.1 SeaMonkey/2.6.1 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.php:4571 Scott Johnson wrote: > public function __construct($uom_ary, $months_ary) > { > $this->uom_ary = $uom_ary; > $this->months_ary = $months_ary; > } > > Previously I just used the global at the top of each method but had to add it > for each method needing the array. Why not supply the information as arguments for the constructor. -- //Aho