Re: [PHP] casting arrays as objects

2001-04-13 Thread Dean Hall
"Morgan Curley" <[EMAIL PROTECTED]> wrote: > why mot [sic] just > $foo = new Foo( $db->fetchRow(DB_FETCHMODE_ASSOC) ); > ?> > > If you have to leave this part of the project for any length of time, > coming back to the above would be much less confusing. ( i think so anyway :) Good ide

Re: [PHP] casting arrays as objects

2001-04-13 Thread Morgan Curley
why mot just fetchRow(DB_FETCHMODE_ASSOC) ); ?> If you have to leave this part of the project for any length of time, coming back to the above would be much less confusing. ( i think so anyway :) morgan At 03:12 PM 4/13/2001 -0500, you wrote: >Can you cast an array to an object of your choosin

[PHP] casting arrays as objects

2001-04-13 Thread Dean Hall
Can you cast an array to an object of your choosing? If so, will the keys of the array match up with the attributes of your object? Say I have a class like this: class Foo { var $foo; var $bar; function Foo($foo = '', $bar = '') { ... } ... } Then I have an array like: