xref: /PHP-8.0/tests/classes/iterators_005.phpt (revision a8d901a8)
1--TEST--
2ZE2 iterators cannot implement Traversable alone
3--FILE--
4<?php
5
6class test implements Traversable {
7}
8
9$obj = new test;
10
11foreach($obj as $v);
12
13print "Done\n";
14/* the error doesn't show the filename but 'Unknown' */
15?>
16--EXPECTF--
17Fatal error: Class test must implement interface Traversable as part of either Iterator or IteratorAggregate in %s on line %d
18