note 92027 deleted from class.seekableiterator by danbrown
| From: | danbrown@php.net | Date: | Mon, 06 Jul 2009 12:30:10 +0000 |
| Subject: | note 92027 deleted from class.seekableiterator by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-157963@lists.php.net to get a copy of this message | ||
Note Submitter: joris at prezent dot nl
----
Instead of checking for the seek method inside a class (like dreake does below) it is better (and
easier) to check if an object implements the SeekableIterator.
Example:
<?php
$it = new MySeekableIterator();
if ($it instanceof SeekableIterator) {
// object contains the seek method (and all other methods that are defined in the
SeekableIterator interface)
}
?>