xref: /PHP-7.4/Zend/tests/anon/009.phpt (revision 49608e06)
1--TEST--
2testing traits in anon classes
3--FILE--
4<?php
5
6trait Foo {
7    public function someMethod() {
8      return "bar";
9    }
10}
11
12$anonClass = new class {
13    use Foo;
14};
15
16var_dump($anonClass->someMethod());
17--EXPECT--
18string(3) "bar"
19