mirror of
https://github.com/php/php-src.git
synced 2024-10-17 14:32:37 +00:00
22 lines
254 B
Plaintext
22 lines
254 B
Plaintext
|
--TEST--
|
||
|
Single Trait with simple trait method
|
||
|
--FILE--
|
||
|
<?php
|
||
|
error_reporting(E_ALL);
|
||
|
|
||
|
trait THello {
|
||
|
public function hello() {
|
||
|
echo 'Hello';
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class TraitsTest {
|
||
|
use THello;
|
||
|
}
|
||
|
|
||
|
$test = new TraitsTest();
|
||
|
$test->hello();
|
||
|
?>
|
||
|
--EXPECTF--
|
||
|
Hello
|