Date: 07/05/00
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #5376 Updated: PHP (compiled inside apache 1.3.12) crashes frequently."
- Previous message: waldschrott: "[PHP-DEV] subsequent calls to create_function create raising names lambda_$n *lasting over scripts end*"
- In reply to: jalal: "Re: [PHP-DEV] adding objects with + equal to array process"
- Next in thread: Kristian Köhntopp: "Re: [PHP-DEV] adding objects with + equal to array process"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> $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 <email protected> | O ° o ° o-¬--o--0-----©-·--O-----o-----0-¤----------o 0 ° · ° . ¤ ·-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #5376 Updated: PHP (compiled inside apache 1.3.12) crashes frequently."
- Previous message: waldschrott: "[PHP-DEV] subsequent calls to create_function create raising names lambda_$n *lasting over scripts end*"
- In reply to: jalal: "Re: [PHP-DEV] adding objects with + equal to array process"
- Next in thread: Kristian Köhntopp: "Re: [PHP-DEV] adding objects with + equal to array process"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

