XDebugを導入することで、エラーやvar_dumpの出力結果が整形されて見やすくなります。
$a = array( 'one', '02'=>2, TRUE, 0.1 ); var_dump( $a );
| 適用前 |
array(4) {
[0]=>
string(3) "one"
["02"]=>
int(2)
[1]=>
bool(true)
[2]=>
float(0.1)
}
|
|---|---|
| 適用後 |
array 0 => string 'one' (length=3) '02' => int 2 1 => boolean true 2 => float 0.1 |
| 適用前 | |
|---|---|
| 適用後 | ![]() |
出力結果を整形して表示するには、php.iniでhtml_errorsディレクティブをOnとする必要があります。
Eclipseのデバッガーとして使用することで、ステップ実行などができるようになります。 All Configuration Settings - Xdebug: Documentation All Functions - Xdebug: Documentation
Windowsではダウンロードした.dllを、php.iniのextension_dirのディレクトリに配置します。そしてphp.iniにzend_extension=xdebugを追記して、サーバーを再起動します。