From: namarpi at yahoo dot com Operating system: Irrelevant PHP version: 5.4.13 Package: Class/Object related Bug Type: Feature/Change Request Bug description:Traits - ask for get_trait_methods
Description: ------------ --- >From manual page: http://www.php.net/language.oop5.traits --- I would like to ask for a method which should be called get_trait_methods, and acts like the get_class_methods. Test script: --------------- // file1.php trait My_Trait { function trait_method_1() {} function trait_method_2() {} } // file2.php class My_Class { use My_Trait; function class_method_1() { $trait_methods = get_class_methods( 'My_Trait' ); // <-- get_trait_methods print_r( $trait_methods ); } function class_method_2() {} } $my_object = new My_Class(); $my_object->class_method_1(); Expected result: ---------------- Array ( [0] => trait_method_1 [1] => trait_method_2 ) Actual result: -------------- Recently get_class_methods does this job. -- Edit bug report at https://bugs.php.net/bug.php?id=64514&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64514&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64514&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64514&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64514&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64514&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64514&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64514&r=needscript Try newer version: https://bugs.php.net/fix.php?id=64514&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=64514&r=support Expected behavior: https://bugs.php.net/fix.php?id=64514&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64514&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64514&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64514&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64514&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64514&r=dst IIS Stability: https://bugs.php.net/fix.php?id=64514&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=64514&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64514&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64514&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64514&r=mysqlcfg
