Kudose wrote:I was looking into some Pear files and noticed some statements like:
$res =& $db->query('DELETE * FROM clients');
What's the =& about? Does it pass a reference of the $db objects result to $res?
$res is a reference for $db->querys results. meaning if the results of $db->query change $res will reflect them as $res is just an alias to the real information of the object.
whoever wrote it most likely uses C as there really isn't a major need for this unless you're working with lots of information and don't want to have duplicate variables stored at once. (having variables, objects, and arrays of duplicate information just create more overhead - if this is small amounts of information its not a big deal as it will be cleared once the execution of the script ends these are cleared.
In C if an application continues running it will continue to store these details until they are unset / altered or destroyed. (taking up more memory when unneeded in a consistent state).