In PHP you can do something like $arr = compact('var1' , 'var2' , 'var3') PHP: and get an array filled with values of the specified variables. Is there a similar function to build an Object out of variables? Something like: $obj = compactObj('var1' , 'var2' , 'var3') PHP:
have you checked out PHP's serialize and unserialize functions? see http://www.phpbuilder.com/manual/en/function.serialize.php