is there any php function for checking variable description?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
metaclay
Forum Newbie
Posts: 1
Joined: Mon Feb 16, 2009 4:01 pm

is there any php function for checking variable description?

Post by metaclay »

hi, i'm php newbie, usually the big script is broke down into smaller file to make them more easy to debug and making a good structure. Now in my case:

1. i create a lot of functions saved in many different file, then within the main php file i use include to call the function. I have a variable , let's call it $finalresult, which is an instance of a class/obj , where this class is also an instance of another class, and so on.... . So sometime after instancing in many level, i forgot the structure of this $final variable. so i have to go up level then opening the reference class one by one until i got the master class. If i have to do it over and over again , it will need a lot of time. so my question.. is there any other faster way to do it? for example .. is there any php function that can show the structure of the variable in detail??

2. is there any php script editor software where i can do something like inserting the breakpoint , so i can run and debug easily. or where i can run the script line by line, so i can watch the changes of my variable in realtime. is it possible? is there such program?? sorry for the stupid question :D


thanx
andi
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: is there any php function for checking variable description?

Post by Benjamin »

Code: Select all

 
var_dump();
debug_backtrace();
 
Eclipse PDT may offer the debug feature you require.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: is there any php function for checking variable description?

Post by Weirdan »

metaclay wrote:2. is there any php script editor software where i can do something like inserting the breakpoint , so i can run and debug easily. or where i can run the script line by line, so i can watch the changes of my variable in realtime. is it possible? is there such program?? sorry for the stupid question :D
You can use either xdebug (free) or zend platform debugger (costly) for this.

Code: Select all

 
var_dump();
debug_backtrace();
 
+

Code: Select all

 
class_parents();
class_implements();
get_class_methods();
get_object_vars();
ReflectionClass();
// etc
 
Post Reply