mirror of
https://github.com/php/php-src.git
synced 2024-10-16 22:12:33 +00:00
c95b4ace40
# It's the last one now, thus the traits can be used to implement interfaces
26 lines
229 B
PHP
26 lines
229 B
PHP
--TEST--
|
|
Using traits to implement interface
|
|
--FILE--
|
|
<?php
|
|
|
|
trait foo {
|
|
public function abc() {
|
|
}
|
|
}
|
|
|
|
interface baz {
|
|
public function abc();
|
|
}
|
|
|
|
class bar implements baz {
|
|
use foo;
|
|
|
|
}
|
|
|
|
new bar;
|
|
print "OK\n";
|
|
|
|
?>
|
|
--EXPECT--
|
|
OK
|