I find it hard to believe that it only works with &$this
as the error message states that it is passing the object by value [aka, as $this
] anyways.
Additionally, global
in a class declaration? Bad. Horribad. Why are you not doing the following instead?
$LIST[] = new MyObject();
And if PHP4 is so archaic that the $arr[]
syntax is not yet valid, then:
array_push($LIST, new MyObject());
Also, holy god. PHP4? Upgrade it. Seriously. I don't think you can possibly come up with a valid reason to still be using PHP4 at this point.