From: Justin F. <je...@ey...> - 2001-06-23 23:07:30
|
Alex: Perhaps this is a question proper for the PHP list, but since I have been scratching my head over something I found in Page.php, I am asking for edification. Now I am an old C programmer and I am familiar with Lvalues and Rvalues and memory layout and references. And I have written many a comparison functions to sort data structures to pass as arguments into xxx_cmp() functions. BUT, I don't understand: uasort($this->modules[$group], array(&$this,'_ary_sort')); where the second argument is "normally" supposed to be the function to be used for the sorting, user supplied. I just don't understand why this works. The knee-jerk call would be: uasort($this->modules[$group],&$this->_ary_sort); which doesn't work, and messing about with it I got a facinating error message coughed up by PHP (probably from Zeev) that was in transliterated/ASCII'ized Hebrew. It made me pause for a moment to think how marvelous open source is...... How is this idiom of using an array getting the Lvalue of the function??? This is probably a waste of everybody's time. I hope someone else wondered. -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722 |