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! 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. 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. 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
Archived
This topic is now archived and is closed to further replies.