I want to alternate between different operation modes without having to introduce additional control structures into a piece of software.
This could be archieved by setting an optional parameter to a function that does not affect the programs state. It should accept an arbitrary number of mixed-type arguments while not causing significant overhead at runtime. Then you would call the parameter each time the code runs. Assuming debugging is what you want to be done, the use would be like function f ($arg, $mode = 'array') { function debug () { echo $arg }; $mode ($arg); compute (); } . array () suffices but introduces to overhead when large chunks of data (e.g. pieces of code) are passed to it. Any suggestions on this? D. Alvarez Arribas <[EMAIL PROTECTED]> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]