--TEST-- Single Trait with simple trait method --FILE-- name . PHP_EOL; $this->foo(); } public function foo(): void { $array = [ 'count' => self::$count, 'baz' => self::BAZ, ]; var_dump($array); } } class TraitsTest { use THello; } function main() { $test = new TraitsTest(); $test->hello(); } ?> --EXPECT-- Hello world array(2) { ["count"]=> int(0) ["baz"]=> string(3) "baz" }