Use the VarDumper component for variable inspection
8.2var_dump() function. It offers a dump() function designed to walk through any arbitrary PHP variable, providing a more readable and structured output for debugging purposes.repository·8.2·Indexed 27 days ago
https://github.com/symfony/var-dumperA PHP component providing advanced mechanisms for inspecting and walking through arbitrary variables as a readable alternative to var_dump(). Includes a dump server via the server:dump command and var-dump-server binary to collect and display dumps in CLI or HTML formats.
var_dump() function. It offers a dump() function designed to walk through any arbitrary PHP variable, providing a more readable and structured output for debugging purposes.You can specify the address the VarDumper server should listen to using the --host option or the VAR_DUMPER_SERVER environment variable.
Option:
--host <address>: The address the server should listen to (e.g., 127.0.0.1:9912).The server:dump command supports different output formats via the --format option. By default, it uses cli.
cli: Standard command-line output.html: Formatted HTML output, ideal for viewing in a web browser.View dumps in the terminal (default):
php server:dumpGenerate an HTML file to view in a browser:
Redirect the output to an HTML file using the --format=html option:
php server:dump --format="html" > dump.htmlThe var-dump-server binary starts a server that collects and outputs dumps in a single location, supporting multiple formats. By default, it listens on 127.0.0.1:9912.
To run the server, ensure you have installed the dependencies via Composer and that the symfony/console component is available in your project.
The server:dump command starts a dump server that collects and displays dumps from your application in a single place. This is useful for debugging applications where standard output might be difficult to access or when you want to view dumps in a structured HTML format.
To run the server, use the following command:
php bin/console server:dump(Note: Replace bin/console with the actual path to your console executable.)
DumpDescriptorInterface. This allows you to define how dumped data is described and rendered to the console output. The describe method provides access to the output stream, the cloned data, a context array, and the client ID.