A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2008 yearGet all the defined functions for an object - page 1
User InfoPosts
Get all the defined functions for an object#1
Is there an equivalent of get_defined_functions() which only shows the functions of a given object?

Example usage and output:

class A {
function foo() { }
function bar() { }
}
class B extends A {
function foobar() { }
}
$b = new B();
print_r(get_object_functions($b));

// Array (
// 0 => "foo",
// 1 => "bar",
// 2 => "foobar"
//)

posted date: 2008-12-14 21:26:00


Re: Get all the defined functions for an object#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2008-12-14 21:26:01


Re: Get all the defined functions for an object#3
Ah I found it:get_class_methods()

posted date: 2008-12-14 21:27:00


Re: Get all the defined functions for an object#4
You could use ReflectionClass...

posted date: 2008-12-14 21:28:00


Re: Get all the defined functions for an object#5
NOTE: this will get instance methods too, not just class methods. I got confused by this.

posted date: 2015-05-13 12:48:00


select page: « 1 »
Copyright ©2008-2017 www.momige.com, all rights reserved.