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5TbSI?`Ըrsyz83}WS#~ǹmTN+൩4󬜼)PdA0rspO&<&b !`Â2z{6NPbȖ }N)xu,E@[ɿ TL]8> f ҷ -{4*nnCf~P%9\Sl'G}MQ8.rG Baլ h>!_y€YԒ'.̯w ۥF ~-%PZ5«1A3xy/YEBq|g)~)˥F{P7OS}Y4s.*M%@IwsT 3Ե下J#;tn5F=1vJ/Q0 _r 5XH?9P _5(028buc rK,ZR$ izoI^ѿ8BfP{݈ZyH=܎gA,Do{U&?}T0?] U@̓٭Y T9s?it"Uu+4_ ߹' :''=: b&| S̵՚hyB]M'uqpGpCmpgф؝9-ZA!oh*O2 -MwgϷI0 ]4ҩBʯ=6DӅ}+>,Oar_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.