neoform Posted March 7, 2007 Share Posted March 7, 2007 I've done this a million times in javascript, but never tried in php.. Is there a way to pass functions by variables? eg. $var = function() { ... } Quote Link to comment https://forums.phpfreaks.com/topic/41669-solved-passing-functions-by-reference/ Share on other sites More sharing options...
neoform Posted March 7, 2007 Author Share Posted March 7, 2007 apparently i should read php.net more.. http://ca.php.net/manual/en/functions.variable-functions.php Quote Link to comment https://forums.phpfreaks.com/topic/41669-solved-passing-functions-by-reference/#findComment-201912 Share on other sites More sharing options...
Ninjakreborn Posted March 7, 2007 Share Posted March 7, 2007 Sorry to pop in here on a solved topic, but you want to make sure your careful about passing functions through variables that user's have control over. That is something you want to be very careful of. Quote Link to comment https://forums.phpfreaks.com/topic/41669-solved-passing-functions-by-reference/#findComment-201919 Share on other sites More sharing options...
neoform Posted March 7, 2007 Author Share Posted March 7, 2007 Nah, it's not user controlled. It's more an issue of scalability.. I'm making a module system that allows for a variable number of functions in each module.. Nothing is controlled/edited through the web, it's all hardcoded files, but I see your point. Quote Link to comment https://forums.phpfreaks.com/topic/41669-solved-passing-functions-by-reference/#findComment-201946 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.