php-src/Zend/tests/bug65579.phpt
Adam Harvey 72027cd084 Fix bug #65579 (Using traits with get_class_methods causes segfault).
Specifically, this checks if there are trait aliases defined in the class scope
before attempting to dereference the first trait alias. This handles the case
where a trait alias was used in a child trait but no aliases exist in the
concrete class.
2013-08-28 20:33:42 -07:00

30 lines
495 B
PHP

--TEST--
Bug #65579 (Using traits with get_class_methods causes segfault)
--FILE--
<?php
trait ParentTrait {
public function testMethod() { }
}
trait ChildTrait {
use ParentTrait {
testMethod as testMethodFromParentTrait;
}
public function testMethod() { }
}
class TestClass {
use ChildTrait;
}
$obj = new TestClass();
var_dump(get_class_methods($obj));
?>
--EXPECT--
array(2) {
[0]=>
string(10) "testMethod"
[1]=>
string(25) "testmethodfromparenttrait"
}