![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,799
Rep Power: 5
![]() |
Re: Function too convoluted?
That's pretty intense...
I only assumed it does. I thought create_function returns a reference to the anonymous function, just as a function name is a reference to a named function. PHP Syntax (Toggle Plain Text)
Is equivilent to: PHP Syntax (Toggle Plain Text)
|
|
|
|
|
|
#12 |
|
King of Portal
|
Re: Function too convoluted?
Doesn't appear to be possible as I get the following error messages when I tested that little snippet out:
Undefined variable: newfunc in ... on line # Fatal error: Function name must be a string in ... on line #
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#13 |
|
King of Portal
|
Re: Function too convoluted?
Figured it out Sane, rather than doing it that way you would use call_user_func. So that array_filter_multi would become
PHP Syntax (Toggle Plain Text)
PHP Syntax (Toggle Plain Text)
PHP Syntax (Toggle Plain Text)
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#14 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,799
Rep Power: 5
![]() |
Re: Function too convoluted?
I will have to add that to my arsenal of handy functions.
![]() |
|
|
|
|
|
#15 |
|
King of Portal
|
Re: Function too convoluted?
One final correction it can work the way you said Sane, but it needs one extra step:
PHP Syntax (Toggle Plain Text)
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#16 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,799
Rep Power: 5
![]() |
Re: Function too convoluted?
Ah, I see. So it would have worked the way I said, except when I posted:
function callback_func($key, $value) { return ($value < 2 || $value > 70); }
print_r(array_filter_multi($data, $callback_func, null));It was actually: function callback_func($key, $value) { return ($value < 2 || $value > 70); }
print_r(array_filter_multi($data, 'callback_func', null)); |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 'function prototype'.... | Konnor | C++ | 3 | Sep 4th, 2005 6:19 AM |
| Recommended Practice for returning data from function | Arla | C# | 1 | Aug 16th, 2005 12:21 PM |
| change the empty function from the old format to the new format | powah | Sed and Awk | 0 | Jun 23rd, 2005 11:10 AM |
| Sort function vs. sort_heap function + Transform Function | Josef_Stalin | C++ | 2 | May 2nd, 2005 11:18 AM |
| Returning a value from a variable to the main function | colt | C | 3 | Apr 28th, 2005 7:56 AM |