mirror of
https://github.com/php/php-src.git
synced 2024-12-18 14:30:35 +08:00
e9ae581f02
Master only, as this depends on fixes to calling order of interface implementation handlers.
23 lines
429 B
PHP
23 lines
429 B
PHP
--TEST--
|
|
Bug #62609: Allow implementing Traversable on abstract classes (work)
|
|
--FILE--
|
|
<?php
|
|
|
|
abstract class AbstractTraversable implements Traversable {}
|
|
|
|
class NonAbstractTraversable extends AbstractTraversable implements IteratorAggregate {
|
|
public function getIterator() {
|
|
yield "foo";
|
|
yield "bar";
|
|
}
|
|
}
|
|
|
|
foreach (new NonAbstractTraversable as $value) {
|
|
echo $value, "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
foo
|
|
bar
|