| | |
Return Functions/Methods in a class
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Hi all,
I was wondering if there is a way of getting the list of functions inside a class in PHP4.
This would be similar to the ReflectionClass in php5.
Say for example I have:
[PHP]class testclass {
function func1() {
echo 'I am func1';
}
function func2() {
echo 'I am func2';
}
}
$ana = new Analysis('testclass');
$ana->getFunctionsList(); // should return array( 'func1', 'func2' );[/PHP]
Is there such a function in php4? or if someone knows of a way to get that information?
I was thinking of serializing the class, and then using regex to get the functions out of the serialized string, but there should be an easier way?
Thanks in advance
I was wondering if there is a way of getting the list of functions inside a class in PHP4.
This would be similar to the ReflectionClass in php5.
Say for example I have:
[PHP]class testclass {
function func1() {
echo 'I am func1';
}
function func2() {
echo 'I am func2';
}
}
$ana = new Analysis('testclass');
$ana->getFunctionsList(); // should return array( 'func1', 'func2' );[/PHP]
Is there such a function in php4? or if someone knows of a way to get that information?
I was thinking of serializing the class, and then using regex to get the functions out of the serialized string, but there should be an easier way?
Thanks in advance
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
•
•
Join Date: May 2005
Posts: 19
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by digital-ether
Hi all,
I was wondering if there is a way of getting the list of functions inside a class in PHP4.
With those, you can list all functions available within your actually running script.
Thanks alot man!
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
Similar Threads
- class (builtin?) methods (Python)
- Passing a filestream, how? (C++)
- How many public methods does class D have? (C)
- Errors with membering functions in a class (C++)
- Basic problem calling methods within a class (Java)
- Accessing functions from base class (C)
Other Threads in the PHP Forum
- Previous Thread: php/mysql communication problem
- Next Thread: listbox--issue php
Views: 3083 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email encode error file files folder form forms function functions google howtowriteathesis href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail menu methods mlm mod_rewrite multiple multipletables mysql oop parse paypal pdf php problem provider query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure syntax system table template tutorial update updates upload url validation validator variable video web xml youtube






