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