1
0
mirror of https://github.com/php/php-src.git synced 2026-04-18 21:41:22 +02:00
Files
archived-php-src/Zend/tests/traits/language007.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

30 lines
434 B
PHP

--TEST--
Traits can fulfill the requirements of abstract base classes.
--FILE--
<?php
error_reporting(E_ALL);
abstract class Base {
abstract function sayWorld();
}
trait Hello {
public function sayHello() {
echo 'Hello';
}
public function sayWorld() {
echo ' World!';
}
}
class MyHelloWorld extends Base {
use Hello;
}
$o = new MyHelloWorld();
$o->sayHello();
$o->sayWorld();
?>
--EXPECT--
Hello World!