VarDumper Component
The VarDumper component provides mechanisms for walking through any arbitrary PHP variable. It provides a better dump()
function that you can use instead of var_dump
.
The VarDumper component provides mechanisms for walking through any arbitrary PHP variable. It provides a better dump()
function that you can use instead of var_dump
.
Var-dumper requires the iconv extension. I was using it on a freshly installed PHP instance and got the following fatal error:
Error: Call to undefined function Symfony\Component\VarDumper\Dumper\iconv_strlen() in Symfony\Component\VarDumper\Dumper\CliDumper->dumpString() (line 172 of vendor/symfony/var-dumper/Dumper/CliDumper.php).
We may want to see the output based on the conditions, so dd_if
will make our job easier.
$value = 1;
$data = [1, 2, 3, 4, 5];
dd_if(in_array($value, $data));
| Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | yes | Deprecations? | no
Added support of FFI:
$ffi = \FFI::cdef(<<<'CPP'
typedef struct { int x; int y; } Point;
typedef struct Example {
uint8_t array[32];
long longVal;
__extension__ union {
__extension__ struct { short shortVal; };
struct { Point point; float e; };
};
bool boolValue;
int (*func)(struct __sub *h);
} Example;
CPP);
$struct = $ffi->new('Example');
$struct->func = (static fn (object $ptr) => 42);
dump($struct);
Before
FFI\CData {#2}
After
FFI\CData<struct Example> size 64 align 8 {#2
+array: FFI\CData<uint8_t[32]> size 32 align 1 {#18}
+int32_t longVal: 0
+int16_t shortVal: 0
+point: FFI\CData<struct <anonymous>> size 8 align 4 {#17
+int32_t x: 0
+int32_t y: 0
}
+float e: 0.0
+bool boolValue: false
+func: [cdecl] callable(struct __sub*): int32_t {#20
returnType: FFI\CType<int32_t> size 4 align 4 {#25}
}
}
Adds ddc helper function as an exhaustive version of dump.
ddc stands for: Die Dump Count
There is a lot of time when the first call to the dd() is not what we want. on the other hand, dump() does not have a break and prints out much more than we want.
This is something in between dd and dump. For example, we want to see what parameters are passed to a method, but that method is called multiple times and the first couple of calls does not matter to us. Or any other debug a process which involves a loop
<?php
$i = 0;
while (true) {
$i++;
ddc(4, $i); // dumps 1, 2, 3, 4 then dies
ddc([0, 4], $i); // same as ddc(4, $i);
}
$i = 0;
while (true) {
$i++;
ddc([2,4], $i); // dumps 3, 4 (skips 1, 2)
}
We can see the objects with namespace that help us to navigate to the file easily.
Before: These are diffrent Collection
class
Now: we can see the diffrent
Possibility to replace existing css style for HTMLDumper without replacing the whole css class definition like changing background-color, font or word-break, etc
e.g.
$dumper->changeStyle('default', 'word-break', 'break-word')
would change css style of word-break
to break-word
from break-all
Calling the dump()
method for the first time is not producing any output. That's because, in the latest change, the first call to the dump
method is not calling the $handler
at all. It's just setting the $handler
.
In this PR, I've tried to fix this issue.
If the ClassStub
needs to work with a class closure, it will throw a FatalErrorException
. I got this:
FatalErrorExceptionError: __debuginfo() must return an array
--
in ClassStub.php line 56
at ReflectionMethod->__construct('\'eZ\\\\Publish\\\\Core\\\\Base\\\\Container\\\\ApiLoader\\\\Storage\\\\ExternalStorageRegistryFactory\'', '\'eZ\\\\Publish\\\\Core\\\\Base\\\\Container\\\\ApiLoader\\\\Storage\\\\{closure}\'') in ClassStub.php line 56
at ClassStub->__construct('identifier' => '\'eZ\\\\Publish\\\\Core\\\\Base\\\\Container\\\\ApiLoader\\\\Storage\\\\ExternalStorageRegistryFactory->eZ\\\\Publish\\\\Core\\\\Base\\\\Container\\\\ApiLoader\\\\Storage\\\\{closure}\'', 'callable' => '???') in ExceptionCaster.php line 163
...
This bugfix handles this situation.
The return type used here will throw an error:
Fatal error: Uncaught TypeError: Return value of Symfony\Component\VarDumper\Dumper\ServerDumper::dump() must be an instance of Symfony\Component\VarDumper\Dumper\void, none returned
This PR simply removes it.
On some systems creating async TCP connection results in "failed to open stream: Resource temporarily unavailable" exception. To solve this, added VAR_DUMPER_ASYNC
variable, which is true
by default, so won't affect default behavior.
If one faces "failed to open stream: Resource temporarily unavailable" error, he should add VAR_DUMPER_ASYNC=0
to .env
file, and problem would be solved.
Changelog (https://github.com/symfony/var-dumper/compare/v6.2.2...v6.2.3)
Changelog (https://github.com/symfony/var-dumper/compare/v6.1.8...v6.1.9)
Changelog (https://github.com/symfony/var-dumper/compare/v6.0.16...v6.0.17)
Changelog (https://github.com/symfony/var-dumper/compare/v5.4.16...v5.4.17)
Changelog (https://github.com/symfony/var-dumper/compare/v6.2.1...v6.2.2)
Changelog (https://github.com/symfony/var-dumper/compare/v6.2.0...v6.2.1)
Changelog (https://github.com/symfony/var-dumper/compare/v6.2.0-RC2...v6.2.0)
Changelog (https://github.com/symfony/var-dumper/compare/v6.2.0-RC1...v6.2.0-RC2)
Changelog (https://github.com/symfony/var-dumper/compare/v6.2.0-BETA3...v6.2.0-RC1)
Changelog (https://github.com/symfony/var-dumper/compare/v6.2.0-BETA2...v6.2.0-BETA3)
Changelog (https://github.com/symfony/var-dumper/compare/v6.1.6...v6.2.0-BETA1)
FFI\CData
and FFI\CType
types (SerafimArts)Changelog (https://github.com/symfony/var-dumper/compare/v6.1.5...v6.1.6)
Changelog (https://github.com/symfony/var-dumper/compare/v6.0.13...v6.0.14)
Changelog (https://github.com/symfony/var-dumper/compare/v5.4.13...v5.4.14)
Changelog (https://github.com/symfony/var-dumper/compare/v4.4.46...v4.4.47)
Changelog (https://github.com/symfony/var-dumper/compare/v6.1.4...v6.1.5)
Changelog (https://github.com/symfony/var-dumper/compare/v6.0.12...v6.0.13)
Changelog (https://github.com/symfony/var-dumper/compare/v5.4.12...v5.4.13)
Changelog (https://github.com/symfony/var-dumper/compare/v4.4.45...v4.4.46)
Changelog (https://github.com/symfony/var-dumper/compare/v6.1.2...v6.1.3)
Changelog (https://github.com/symfony/var-dumper/compare/v6.0.10...v6.0.11)
Changelog (https://github.com/symfony/var-dumper/compare/v5.4.10...v5.4.11)
Changelog (https://github.com/symfony/var-dumper/compare/v4.4.43...v4.4.44)
Changelog (https://github.com/symfony/var-dumper/compare/v6.1.0-RC1...v6.1.0)
Changelog (https://github.com/symfony/var-dumper/compare/v6.0.8...v6.0.9)
Changelog (https://github.com/symfony/var-dumper/compare/v5.4.8...v5.4.9)
Changelog (https://github.com/symfony/var-dumper/compare/v4.4.41...v4.4.42)
Changelog (https://github.com/symfony/var-dumper/compare/v6.1.0-BETA2...v6.1.0-RC1)
Changelog (https://github.com/symfony/var-dumper/compare/v6.1.0-BETA1...v6.1.0-BETA2)
Changelog (https://github.com/symfony/var-dumper/compare/v6.0.7...v6.0.8)
BetterConfig WARNING: This virion is under development and haven't been tested. Do not use this virion unless you know what you're doing. Contribution
This library can parse a TypeSchema specification either from a JSON file, or from PHP classes using reflection and annotations. Based on this schema it can generate source code and transform raw JSON data into DTO objects. Through this you can work with fully typed objects in your API for incoming and outgoing data.
Expose A completely open-source ngrok alternative - written in pure PHP. Documentation For installation instructions, in-depth usage and deployment de
Square Connect PHP SDK - RETIRED replaced by square/square-php-sdk NOTICE: Square Connect PHP SDK retired The Square Connect PHP SDK is retired (EOL)
TOML parser for PHP A PHP parser for TOML compatible with TOML v0.4.0. Support: Installation Requires PHP >= 7.1. Use Composer to install this package
league/config helps you define nested configuration arrays with strict schemas and access configuration values with dot notation.
LOAD LOAD is a PHP library for configuration loading to APCu Sources Available sources for configuration loading are: PHP file Consul Environment vari
GetOptionKit Code Quality Versions & Stats A powerful option parser toolkit for PHP, supporting type constraints, flag, multiple flag, multiple values
Config Config is a file configuration loader that supports PHP, INI, XML, JSON, YML, Properties and serialized files and strings. Requirements Config
VarDumper Component The VarDumper component provides mechanisms for walking through any arbitrary PHP variable. It provides a better dump() function t
A Magento 2 module that adds a CLI bin/magento cms:dump to dump all CMS pages and CMS blocks to a folder var/cms-output.
CakePHP DatabaseLog Plugin DatabaseLog engine for CakePHP applications. This branch is for CakePHP 4.0+. See version map for details. Features Easy se
First MySQLi PHP Connect and work with MySQL/MariaDB database through MySQLi in PHP. The above exercises are designed for students. This is an introdu
QPM QPM全名是 Quick(or Q's) Process Management Framework for PHP. PHP 是强大的web开发语言,以至于大家常常忘记PHP 可以用来开发健壮的命令行(CLI)程序以至于daemon程序。 而编写daemon程序免不了与各种进程管理打交道。Q
Making multiple identical function calls has the same effect as making a single function call.
Better Moderation Plugin Commands /ban <player> <reason> <time> - Bans a player from the server. /blacklist <player> - Blacklists a player from the se
PHP DB Locker Introduction PHP application-level database locking mechanisms to implement concurrency control patterns. Supported drivers: Postgres In
_s Hi. I'm a starter theme called _s, or underscores, if you like. I'm a theme meant for hacking so don't use me as a Parent Theme. Instead try turnin
IP-Tracer is used to track an ip address. IP-Tracer is developed for Termux and Linux based systems. you can easily retrieve ip address information using IP-Tracer. IP-Tracer use ip-api to track ip address.
⚠️ Please note that the V8 is an important (with small BC breaking) update of PhpFastCache ! As the V8 is relatively not compatible with previous vers