mrherman Posted June 3, 2012 Share Posted June 3, 2012 Hi -- I have a debugging function that called like this trace_log( file_name(__FILE__), script_name(), __FUNCTION__, __LINE__, var_name(), var_value()); As I use it many times within a script, is there a way to group the parameters in a variable or constant in order to make the line of code less cumbersome? I know the following won't work, but to give an example of what I mean: $paramList= "file_name(__FILE__), script_name(), __FUNCTION__, __LINE__, var_name(), var_value()"; trace_log( $paramList ); Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/263568-how-to-place-function-parameters-list-in-a-variable-for-tidiness/ Share on other sites More sharing options...
trq Posted June 3, 2012 Share Posted June 3, 2012 The best you could do would be to make your function accept an array. Quote Link to comment https://forums.phpfreaks.com/topic/263568-how-to-place-function-parameters-list-in-a-variable-for-tidiness/#findComment-1350759 Share on other sites More sharing options...
mrherman Posted June 3, 2012 Author Share Posted June 3, 2012 Thanks! That's what I was thinking, but I wanted to make sure. Quote Link to comment https://forums.phpfreaks.com/topic/263568-how-to-place-function-parameters-list-in-a-variable-for-tidiness/#findComment-1350858 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.