summaryrefslogtreecommitdiff
path: root/Zend/tests/anon/009.phpt
blob: b7bf254058e30a99747fc443e60f3782aaced53c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--TEST--
testing traits in anon classes
--FILE--
<?php

trait Foo {
    public function someMethod() {
      return "bar";
    }
}

$anonClass = new class {
    use Foo;
};

var_dump($anonClass->someMethod());
?>
--EXPECT--
string(3) "bar"