[PHP] Passing a class through an array

2007-03-08 Thread Jeff Taylor
Hey all, I'm very new to programming and PHP. I want to pass instances of a class through an array, and then use a foreach later to grab details of each class at once... but it returns a fatal error Code: $me = new Toon('Toon1','1') $him = new Toon('Toon2','0') $characterListing = array($me,

[PHP] Re: Troubles from the newb again

2007-03-09 Thread Jeff Taylor
ge the $newarray[$name] to something to represent the current element and just add the value to it? I might be able to work around it then ""Jeff Taylor"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hey everyone, > Newb back again - Im trying to popu

Re: [PHP] Troubles from the newb again

2007-03-09 Thread Jeff Taylor
; } else { $newarray[$name] = 2; } } Sorry for the spam everyone "Robert Cummings" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sat, 2007-03-10 at 15:31 +1030, Jeff Taylor wrote: > > Hey everyone, > > Newb back again - Im trying to

Re: [PHP] Passing a class through an array

2007-03-15 Thread Jeff Taylor
; > > On Thu, March 8, 2007 11:51 pm, Jeff Taylor wrote: > > Hey all, > > I'm very new to programming and PHP. > > I want to pass instances of a class through an array, and then use a > > foreach > > later to grab details of each class at once... but it returns

[PHP] working with class inheritance

2007-03-20 Thread Jeff Taylor
Hey all, got a slight problem, where for some reasons my variables dont seem to be getting stored in the child class: e.g class Parent { $private type; public function __construct() { } public function GetType() { return $this->type; } } class Child implements Parent {

[PHP] Re: working with class inheritance

2007-03-20 Thread Jeff Taylor
OOPS!... typo Please replace implements with extends: class Child extends Parent Sorry about that ""Jeff Taylor"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hey all, got a slight problem, where for some reasons my variables dont seem > t

[PHP] Re: working with class inheritance

2007-03-20 Thread Jeff Taylor
Child class __construct $this->foo.='Bar'; $this->foo2 .= rand(1,6); $this->type = 'Child'; Outputs of variables foo == Bar Bar foo2 == 11-16 type == Child Th

Re: [PHP] working with class inheritance

2007-03-20 Thread Jeff Taylor
Thanks everyone, Gave me a much better understanding of it "Jim Lucas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Jim Lucas wrote: > > Jeff Taylor wrote: > >> Hey all, got a slight problem, where for some reasons my variables > >>