note 92027 added to class.seekableiterator

From: Date: Mon, 06 Jul 2009 10:08:32 +0000
Subject: note 92027 added to class.seekableiterator
Groups: php.notes 
Request: Send a blank email to php-notes+get-157954@lists.php.net to get a copy of this message
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) } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 82.93.161.233 ---- Manual Page -- http://www.php.net/manual/en/class.seekableiterator.php Edit -- https://master.php.net/note/edit/92027 Del: integrated -- https://master.php.net/note/delete/92027/integrated Del: useless -- https://master.php.net/note/delete/92027/useless Del: bad code -- https://master.php.net/note/delete/92027/bad+code Del: spam -- https://master.php.net/note/delete/92027/spam Del: non-english -- https://master.php.net/note/delete/92027/non-english Del: in docs -- https://master.php.net/note/delete/92027/in+docs Del: other reasons-- https://master.php.net/note/delete/92027 Reject -- https://master.php.net/note/reject/92027 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#157954) next »