The var_dump function is one way to see what’s happening in your PHP program. It’ll dump a variable value to stdout. There are other functions you can use for debugging through outputs. Here are a few and how they’ll help you:
$myVar = "hello world!"; var_dump($myVar); print_r($myVar); $allVars = get_defined_vars(); print_r($allVars); debug_zval_dump($allVars); function sayHello($hello) { echo $hello; debug_print_backtrace(); } sayHello($myVar);
These functions are a quick way to debug your PHP code. You can see them in action in this Paiza. Each function has a purpose and can be useful for debugging.
PHP has a few ways to configure error reporting. You can use the php.ini file, if you have access to it. Otherwise, you might use the htaccess configuration. If you can’t use configuration files, you have the option of changing the values via a script. This is possible, but think about how you would change modes after deploying your application.
A combination of settings will get you the right levels of error logging. You’ll want to consider the following settings:
We can use xdebug library and setup on IDE
Total : 27273
Today :9
Today Visit Country :