xref: /PHP-8.4/Zend/tests/bug65579.phpt (revision 53efa1b0)
1--TEST--
2Bug #65579 (Using traits with get_class_methods causes segfault)
3--FILE--
4<?php
5trait ParentTrait {
6    public function testMethod() { }
7}
8
9trait ChildTrait {
10    use ParentTrait {
11        testMethod as testMethodFromParentTrait;
12    }
13    public function testMethod() { }
14}
15
16class TestClass {
17    use ChildTrait;
18}
19
20$obj = new TestClass();
21var_dump(get_class_methods($obj));
22?>
23--EXPECT--
24array(2) {
25  [0]=>
26  string(10) "testMethod"
27  [1]=>
28  string(25) "testMethodFromParentTrait"
29}
30