|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-07-13 23:03 UTC] yohgaki@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: yohgaki
[2014-07-13 23:03 UTC] yohgaki@php.net
[2014-07-13 23:05 UTC] yohgaki@php.net
-Status: Closed
+Status: Re-Opened
[2014-07-13 23:05 UTC] yohgaki@php.net
[2017-10-24 03:07 UTC] kalle@php.net
-Status: Re-Opened
+Status: Assigned
[2018-08-05 03:48 UTC] carusogabriel@php.net
-Status: Assigned
+Status: Closed
[2018-08-05 03:48 UTC] carusogabriel@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 06 14:00:02 2026 UTC |
Description: ------------ Specific PHP version: PHP 5.4.23-1+sury.org~precise+1 ReflectionMethod::getPrototype — Gets the method prototype (if there is one). Executing ReflectionClass::getPrototype on class methods, with the class using traits, returns a ReflectionClass with reference to non-existing class methods (these are trait methods). Test script: --------------- <?php trait t { function f() { //do stuff } } class a { function f() { // do stuff } } class c extends a { use t; } $class = new ReflectionClass('c'); foreach ($class->getMethods() as $method) { try { printf('method %s::%s%s', $method->class, $method->name, PHP_EOL); $prototype = $method->getPrototype(); printf('prototype %s::%s%s', $prototype->class, $prototype->name, PHP_EOL); } catch (\ReflectionException $e) { printf('%s%s', $e->getMessage(), PHP_EOL); } } Expected result: ---------------- Two possible expected results: method c::f prototype a::f or method c::f Method c::f does not have a prototype Actual result: -------------- method c::f prototype c::f