Lines Matching refs:callback
14 * @brief A non abstract FiletrIterator that uses a callback foreach element
21 const USE_FALSE = 0; /**< mode: accept no elements, no callback */
22 const USE_TRUE = 1; /**< mode: accept all elements, no callback */
23 const USE_VALUE = 2; /**< mode: pass value to callback */
24 const USE_KEY = 3; /**< mode: pass key to callback */
25 const USE_BOTH = 4; /**< mode: pass value and key to callback */
29 private $callback; /**< callback to use */
38 * @param callback callback function
42 public function __construct(Iterator $it, $callback, $mode = self::USE_VALUE, $flags = 0)
45 $this->callback = $callback;
50 /** Call the filter callback
51 * @return result of filter callback
66 return (bool) call_user_func($this->callback, &$this->current);
68 return (bool) call_user_func($this->callback, $this->current);
72 return (bool) call_user_func($this->callback, &$this->key);
74 return (bool) call_user_func($this->callback, $this->key);
78 return (bool) call_user_func($this->callback, &$this->key, &$this->current);
80 return (bool) call_user_func($this->callback, $this->key, $this->current);