Re: adding objects with + equal to array process
| From: | waldschrott | Date: | Wed, 05 Jul 2000 13:26:11 +0000 |
| Subject: | Re: adding objects with + equal to array process | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-23570@lists.php.net to get a copy of this message | ||
KK> If you are treating objects like arrays, you probably
KK> should have used arrays in the first place.
You´re right. I´m using PHP objects sometimes like arrays, for the reason that PHP allows it, I prefer...
$array_link=&$object->store->array;
instead of
$array_link=&$array['store']['array'];
Ok. PHP objects *should* not be used that way, it´s my fault. I should use arrays, then I´ve array functions available. But it´s enticing - PHP allows it, and it even uses it. Watch the mysql function mysql_fetch_object , it does the same thing.
I´m not alone at least.
KK> $a = new A;
KK> $b = new B;
KK> KK> $c = $a + $b;
KK> KK> What is the type and class of $c? What instance functions
KK> are available to $c?
That should combine all methods and properties and automaticall use the right class from $b or $a if methods have equal names :)
Just kidding...
in fact with *normal* objects which have been instanciated and weren´t create with settype() that shouldn´t be possible
regards
--
o----------0-¬---------O-·---¬----o---®-----o o O ° .
| http://www.kiffen.de | pRoteçt y0ur bRaín |0 O ° ¤ °
·
0°·³°²'²³-¹'³´³°^°³~³²³°'³²²¨³²^³¹³²°²³`³º³°Þ °
o © ° . ·
| psychedelic experience | gott@kiffen.de | O ° o °
o-¬--o--0-----©-·--O-----o-----0-¤----------o 0 ° · ° . ¤ ·