When debugging in PHP and using the variables pane on the left, there is a limit to the amount of characters you can see for that variable/object when hovering over.
Is there anyway to see the full payload for that variable or any work around other than having to use file_put_contents
every time I want to see a large variable value? Also printing the variable to the debug console has the same limitation but adds one extra character (lucky me).
Expand the Search widget to display the Replace text box. When you type text into the Replace text box, you will see a diff display of the pending changes. You can replace across all files from the Replace text box, replace all in one file or replace a single change.
VSCode – Code Formatting Shortcuts The code formatting is available in Visual Studio Code (VSCode) through the following shortcuts or key combinations: On Windows Shift + Alt + F. On macOS Shift + Option + F. On Linux Ctrl + Shift + I.
In order to achieve that you need to make a change in your launch.json configuration of xdebug in VS Code.
The piece of configuration you will need to add to your configuration of launch.json
is "xdebugSettings": { "max_data": -1 }
A simple configuration should look like that
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"serverSourceRoot": "/var/www/myapp/",
"localSourceRoot": "${workspaceRoot}/",
"xdebugSettings": {
"max_data": -1
}
}]
}
xdebugSettings.max_data
Controls the maximum string length that is shown when variables are displayed. To disable any limitation, use -1 as value.
Good luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With