<?php
trait MyTrait
{
public function foo()
{
}
}
class MyClass
{
public function foo()
{
}
}
class Test extends MyClass
{
use MyTrait;
}
$refl = new \ReflectionClass('Test');
var_dump($refl->getMethod('foo')->getPrototype());
Fatal error: Uncaught ReflectionException: Method Test::foo does not have a prototype in /in/dZcQB:24
Stack trace:
#0 /in/dZcQB(24): ReflectionMethod->getPrototype()
#1 {main}
thrown in /in/dZcQB on line 24
Process exited with code 255.
Output for 5.5.25 - 5.5.35, 5.6.9 - 5.6.28
Fatal error: Uncaught exception 'ReflectionException' with message 'Method Test::foo does not have a prototype' in /in/dZcQB:24
Stack trace:
#0 /in/dZcQB(24): ReflectionMethod->getPrototype()
#1 {main}
thrown in /in/dZcQB on line 24
Process exited with code 255.