public static function main($args)
 {
     $enumeration = new MyArrayEnumeration($args);
     while ($enumeration->hasMoreElements()) {
         println($enumeration->nextElement());
     }
     $iterator = new MyArrayIterator($args);
     while ($iterator->hasNext()) {
         println($iterator->next());
     }
 }
Exemple #2
0
 static function test($func, $skip = null)
 {
     echo "==={$func}===\n";
     self::$fail = 0;
     while (self::$fail < 10) {
         try {
             var_dump($func(new MyArrayIterator()));
             break;
         } catch (Exception $e) {
             echo $e->getMessage() . "\n";
         }
         if (isset($skip[self::$fail])) {
             self::$fail = $skip[self::$fail];
         } else {
             self::$fail++;
         }
     }
 }