From: Matthew M. <ma...@tu...> - 2006-03-10 13:00:46
|
On Thu, 2006-03-09 at 17:54 -0500, Verdon Vaillancourt wrote: > 1) > $search = & new Search($this->key_id); Been so long doing this I forgot why I did it. I believe it is because you just want a reference pointing to the class and not a copy. > 2) > function &cpanel() > { > do something; > } This means you are returning a reference point. function &getit() { $a = 1; return $a; } $b = getit(); So instead of creating a new variable ($b) with new memory addresses I just point to the result of the function. > 3) > function _loadCategory(&$cat_item, &$blog, $version=NULL) > { > do something; > } This one is very useful. I can send in a variable, work on it in the function and then return something different. For example, I could parse cat_item, alter the variable, and return TRUE. Also in the example above, I could alter cat_item and blog at the same time. -- Matthew McNaney Electronic Student Services Appalachian State University http://phpwebsite.appstate.edu |