Why is this php function call failing?
<p>I am attempting to use the following PHP class:</p>

<pre><code>&lt;?php 

class Service {

    public $code, $description;

    public static $services = array(
        "A"         =&gt;      "Shipping",
        "B"     =&gt;      "Manufacturing",
        "C"         =&gt;      "Legal",
        "D"         =&gt;      "Accounts Receivable",
        "E"         =&gt;      "Human Resources",
        "F"         =&gt;      "Security",
        "G"         =&gt;      "Executive",
        "H"         =&gt;      "IT"
    );

    public function _construct( $c, $d) {
        $this-&gt;code = $c;
        $this-&gt;description = $d;
    }

    public static function getDescription( $c ){
        return $services[$c];
    }

    public static function generateServiceList() {

        $service_list[] = array();

        foreach ($services as $k =&gt; $v ){
            $service_list[] = new Service( $k, $v );
        }

        return $service_list;

    }

}

?&gt;
</code></pre>

<p>...in the following way:</p>

<pre><code>&lt;?php
    $services = Service::generateServiceList();
?&gt;
</code></pre>

<p>...but getting the following error:</p>

<pre><code>Warning: Invalid argument supplied for foreach() in /classes/service.php on line 31
</code></pre>

<p>Any idea why? Is this some kind of an access issue? Thanks.</p>
