<?php function processor(array $callbacks) { // filter by instance clas $callbacks = array_filter(...); // check number of callbacks for custom logic if (count($callbacks) == 1) { return $callbacks(); } // modyfing by a condition if (DEBUG) { $callbacks[] = debug_logger(...); } return compose($callbacks)(); } function processor2(array $callbacks) { // loop with $callbacks[$i] + $result ??? }
You have javascript disabled. You will not be able to edit any code.