note 108803 added to class.callbackfilteriterator
| From: | dave1010 at gmail dot com | Date: | Fri, 25 May 2012 13:29:33 +0000 |
| Subject: | note 108803 added to class.callbackfilteriterator | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-188224@lists.php.net to get a copy of this message | ||
Implementation for PHP < 5.4:
<?php
if (!class_exists('CallbackFilterIterator')) {
class CallbackFilterIterator extends FilterIterator {
protected $callback;
// "Closure" type hint should be "callable" in PHP 5.4
public function __construct(Iterator $iterator, Closure $callback = null) {
$this->callback = $callback;
parent::__construct($iterator);
}
public function accept() {
return call_user_func(
$this->callback,
$this->current(),
$this->key(),
$this->getInnerIterator()
);
}
}
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 109.104.100.34
----
Manual Page -- http://www.php.net/manual/en/class.callbackfilteriterator.php
Edit -- https://master.php.net/note/edit/108803
Del: integrated -- https://master.php.net/note/delete/108803/integrated
Del: useless -- https://master.php.net/note/delete/108803/useless
Del: bad code -- https://master.php.net/note/delete/108803/bad+code
Del: spam -- https://master.php.net/note/delete/108803/spam
Del: non-english -- https://master.php.net/note/delete/108803/non-english
Del: in docs -- https://master.php.net/note/delete/108803/in+docs
Del: other reasons-- https://master.php.net/note/delete/108803
Reject -- https://master.php.net/note/reject/108803
Search -- https://master.php.net/manage/user-notes.php