A short post today to help you in debugging your applications. You may find yourself someday wondering what variables are currently set and their contents, or what constants have been set by an application or framework you are coding. Well the answer is rather simple using var_dump
function. Here is the breakdown:
List all defined variables with their respective values:
var_dump(get_defined_vars());
List all defined constants with their respective values:
var_dump(get_defined_constants());
List all defined internal and user functions:
var_dump(get_defined_functions());
List all declared classes:
var_dump(get_declared_classes());
That’s it, I hope you get some use out of these functions like i did!