pkboom / dump-variable
Dump with variable name
0.0.4
2022-02-13 05:10 UTC
Requires
- php: ^8.0
- symfony/finder: ^5.0|^6.0
- symfony/var-dumper: ^5.0|^6.0
This package is auto-updated.
Last update: 2024-11-13 11:26:03 UTC
README
Sometimes you might want to dump a variable with a name in php in the same way js does:
let name = "foo"; console.log({ name }); // { name: 'foo'}
You can do this with dv()
or dvd()
in php:
$name = 'foo'; // dump with variable dv($name); // dd with variable dvd($name); // [ '$name' => 'foo' ]
Installation
composer require pkboom/dump-variable --dev