| Start |
|---|
| Dumping variables The Example: Output: |
| Displaying errors If you want PHP to display runtime errors on the page, you have to enable You can choose which errors to display, with the PHP can display errors in text or HTML format, depending on the Example: Plain text output: (HTML format differs between implementations) NOTE: If you have error reporting disabled in php.ini and enable it during runtime, some errors (such as parse errors) won't be displayed, because they occured before the runtime setting was applied. The common way to handle |
phpinfo() WarningIt is imperative that IntroductionHaving said that, it can be a useful tool in understanding the PHP environment (OS, configuration, versions, paths, modules) in which you are working, especially when chasing a bug. It is a simple built in function: It has one parameter You can pass the parameter You can run it in the browser for a nicely formatted detailed look. It also works in PHP CLI, where you can pipe it into ExampleThis will display a list of PHP directives ( |
| Xdebug Xdebug (opens new window) is a PHP extension which provides debugging and profiling capabilities. There are some nice features in this tool:
As you can see this extension is perfectly suited for development environment. Especially remote debugging feature can help you to debug your php code without numerous var_dump's and use normal debugging process as in Usually installing of this extension is very simple: And activate it into your php.ini: In more complicated cases see this instructions (opens new window) When you use this tool you should remember that: |
phpversion() IntroductionWhen working with various libraries and their associated requirements, it is often necessary to know the version of current PHP parser or one of it's packages. This function accepts a single optional parameter in the form of extension name: Example |
Error Reporting (use them both) |
Read Article
https://develop.horje.com/learn/1434/reference