$obj1 = new Schrott;
$obj2 = new Schrott;
add_schrotts( $obj1, $obj2 );
I´m using the function below already, but it does not perform very well on large object. I only use it for objects of 'StdClass' created with settype() and I´m now playing around with create_function() to speed it up, but it would be consequent if we´d make it possible to "add" objects (perhaps only StdClass allowed) with the "+" operator, the array "adding" is very useful too...
function &merge_objects(&$obj,&$obj2) {
$vars=get_object_vars($obj2);
foreach($vars AS $key => $value) {
$obj->$key=$value; } }
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 ° · ° . ¤ ·