Note that this function will answer both class AND instance methods ("class methods" are called "static" in PHP). Sort of a little "trap" for people who have in-depth experience with the OO terminology :-)
![]() |
|
||||||||||
|
get_class_methodsОписаниеarray get_class_methods ( mixed class_name )
Функция возвращает массив имен методов определенных для класса
См. также get_class_vars() и get_object_vars(). get_class_methods
php at stock-consulting dot com
06-Feb-2007 02:40
Note that this function will answer both class AND instance methods ("class methods" are called "static" in PHP). Sort of a little "trap" for people who have in-depth experience with the OO terminology :-)
BoD
15-Mar-2006 07:09
!Concerning PHP5 Only!
jazepstein at greenash dot net dot au
16-Oct-2005 06:37
In PHP4, this function converts its return values to lowercase; but in PHP5, it leaves the return values in their original case. This can cause serious problems when trying to write code that dynamically calls a class method, and that works in both PHP4 and PHP5. This code snippet shows one way of achieving compatibility with both versions:
Bill Kuker
20-Jul-2005 07:26
Contrary to a note below this method seems to exclude private and protected functions.
Oli Filth
11-Apr-2005 08:21
As an extension to onesimus's code below for finding inherited methods, in PHP 5 you can use the Reflection API to find which of these are overriden.
kabatak
20-Feb-2005 05:11
In PHP4, if you need to get_class_methods in their original case. You can use this simple function I created.
r0bin at r0bin dot net
18-Feb-2005 06:21
You cant get the Methods of COM components. So trying to get the methods from an instance of PHP's COM class will fail.
epowell at removethis dot visi dot com
11-Oct-2004 08:47
I've figured out how to get around my issue described below, using the Reflection API.
onesimus at cox dot net
19-Jun-2004 02:32
This function will return only the methods for the object you indicate. It will strip out the inherited methods.
gk at proliberty dot com
01-Jun-2003 04:16
It is important to note that get_class_methods($class) returns not only methods defined by $class but also the inherited methods.
aldo at cerca dot com
21-Apr-2002 10:18
If you use "get_class_methods" to check if a Method is in a Class remember that the function return lowered name of class methods:
matt at zevi dot net
21-Mar-2002 04:46
Win32 only: |