Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #4571

Re: Loading globals into classes

From "J.O. Aho" <user@example.net>
Newsgroups comp.lang.php
Subject Re: Loading globals into classes
Date 2012-01-22 21:09 +0100
Message-ID <9o38ofFagkU1@mid.individual.net> (permalink)
References <jfhghn$rrn$1@dont-email.me>

Show all headers | View raw


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

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Loading globals into classes Scott Johnson <noonehome@chalupasworld.com> - 2012-01-22 09:20 -0800
  Re: Loading globals into classes "J.O. Aho" <user@example.net> - 2012-01-22 21:09 +0100
    Re: Loading globals into classes Scott Johnson <noonehome@chalupasworld.com> - 2012-01-22 14:08 -0800
    Re: Loading globals into classes Scott Johnson <noonehome@chalupasworld.com> - 2012-01-22 14:29 -0800
      Re: Loading globals into classes "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-23 00:32 +0100
        Re: Loading globals into classes Scott Johnson <noonehome@chalupasworld.com> - 2012-01-22 17:10 -0800

csiph-web