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Oq .ֱPc]^skv AYw5l ^2⑀8-)Y=7,aU(^j `k(Dgӆ'9)_T427%A1{1Dn…r24;7lJGkKIÔBz{2ʈ;ll1]KN;.*ݙJq."ٶ>o󖟈 ]@&xݴq'җKw#pGKȬLβ1Cen@`WSFnkl,TA18TB؈si1YȜKYTu# ; @b;}<, j#@m|YgmUB+%^Ɓ16 8┊sZ!2S:& 5_0mq,C#(_E%M}!ԣ TS.7#3($zߩwwxl Mj 9һθ3OFlN#] Cd>į[[D8{o4<(%%DtKm@ $ܳٵOtߥJȢ= 9+Q] *d,PsիR`Hb5[Mm۴ӛSraܛڈeˍPL 0+V^۽qS_BkW}g`KA9aZ&623'Ңk ;d3Nn Z\ՠG-e2DFym^j+hf%zGhN[ igO] ,G! jwIo dM4:[(|"8x0Gsl^X=u ?h[~.NP,YΛ5)ʗiE:|l ݵq>l[?Z!7 Koj+&L9#C-h 4:5b]?43nnuvTT3 gB}SkLvo1.`[yb,aHm Y$lDo> g,6EƝ*orURqS3tLU:@v,΋7Yy _o6:/WMmuԁQ.$(6fco.Mv} :fqPiRb2 `ϣsal3ߧ1}94o~Ft4*7=+#{(^wF֒C> ؝tjUA' 0Kx!?#C$@%jx6ךn\yr;*Vۙҕ'N "*Q+Y թqr I;,rE,ize~4]ޅ$Ix^"7HaT~$ qNgraph">

Xdebug overloads the default var_dump() function with its own version that includes (among other things) color coding for different PHP types, so you can see it in action immediately by using the var_dump() function in a PHP script. For example, create a simple PHP script in the htdocs\ subdirectory of your XAMPP installation directory with the following content:

<?php
var_dump($_SERVER);

When you view your script through a browser, here’s an example of what you might see:

image2

One of Xdebug’s most powerful features is its ability to profile a PHP script and produce detailed statistics on how long each function call or line of code takes to execute. This can be very useful for performance analysis of complex scripts. To turn on script profiling, follow these steps:

  1. Edit the php.ini file in the php\ subdirectory of your XAMPP installation directory. Within this file, find the [XDebug] section and within it, uncomment and modify the lines below so that they look like this:

    xdebug.profiler_append = 0
    xdebug.profiler_enable = 1
    xdebug.profiler_enable_trigger = 0
    xdebug.profiler_output_dir = "C:/xampp/tmp"
    xdebug.profiler_output_name = "cachegrind.out.%t-%s"
  2. Restart the Apache server using the XAMPP control panel.

At this point, Xdebug profiling is active. Every PHP script that you run will be profiled and the results will be placed in the C:\xampp\tmp as a so-called cachegrind file. You can view this cachegrind file with a tool like WinCacheGrind, which you must download and install separately.

To illustrate how this works, consider the screenshot below, which shows the profiled output of a script using WinCacheGrind. As the screenshot illustrates, it’s easy to see the entire life cycle of a PHP script, including the call sequence and the amount of time taken by each function, and thereby find targets for further optimization.

image3
To find out more about Xdebug’s powerful features, read the Xdebug documentation.