Articles
Ce document est aussi disponible en français
IDE editors would like everyone to use their tools to code PHP, and they usually show off impressive debogers. Sadly for them, there are a large number of tools within PHP that give access to a wealth of information. Here is a list of them.
- get_defined_vars() : lists all variables that exist in the script.
- get_defined_functions() : lists all defined functions in the script, up to now.
- get_defined_classes() : lists all defined classes in the script, up to now.
-
get_declared_classes() : lists all declared classes. Also available for interfaces : get_declared_interfaces().
- get_object_vars() : lists all members and their values from an objet, as an array. Do not mistake this with get_object_vars(), which lists all members of a class as an array : this way, you'll get the defaults values.
- get_object_methods() : lists the declared method of an objet.
- get_defined_constants() : lists all defined constants, user-defined and extension-defined.
- get_required_files() : lists all included files, using require(), include(), include_once() and require_once(). Also exist as get_included_files().
- get_loaded_extensions() : lists all available extension, dynamically loaded or not.
- debug_backtrace() : lists all call functions until the current call, with their position within the code source (file and line), and the list of arguments. If you just want to print this, see debug_print_backtrace();
- error_get_last() : get the last PHP generated message.
- memory_get_peak_usage() : lists the maximum amount of consummed memory during the execution of this script. The current level of memory is available using memory_get_usage().
And also, there are the well known functions :
- __FILE__: the PHP file being executed
- __LINE__: the line number of the currently executed PHP file
- __FUNCTION__: function or method being executed (just the name)
- __CLASSE__: the current class
| < Précédent | Suivant > |
|---|
Commentaires
Vous pouvez ajouter votre commentaire! |
Vous devez vous connecter pour commenter


