Web site templates - 589Chapter 32DebuggingThat setting specifies that all errors and

589Chapter 32DebuggingThat setting specifies that all errors and warnings are to be reported (a fact denoted byE_ALL), and (&) that run-time notices are not to be reported (denoted by ~E_NOTICE the ~ indicates NOT). Other possible values are included and documented in the numerous com- ment lines of php.iniitself. The level of reporting defined by error_reportingaffects the behavior of error logging (as enabled by log_errors=On) and error reporting (as enabled by display_errors=On) or both simultaneously if both are enabled. Error-Reporting FunctionsPHP, benevolent language that it is, comes equipped with a variety of functions programmerscan use to help locate problems and generally report on aspects of their programs status. These range from ordinary output-generating statements print(), echoand the like used in contexts that reveal details of variable values, to specialized functions that write tooperating systems logging mechanisms. This section introduces some PHP functions you can use to spot problems and report onyour programs condition. Diagnostic print statementsThe simplest troubleshooting technique involves placing echo and print statements in yourcode at key locations, so that the output contains information about the progress of executionthrough various functions and the values of key variables at different points. This is sort of apoor man s debugger you can trace variables during execution and see if (and if so, when) they change to some unexpected value. Here s a simple program that uses echo statements for tracing purposes: In innerFunction() now… ; $returnValue = $value . things
; echo
$returnValue = ; echo $returnValue; return $returnValue; } function outerFunction() { echo
In outerFunction() now… ;
If you are in need for cheap and reliable webhost to host your website, we recommend http web server services.

Leave a Reply