faydaen / dumper
Replacement of standard var_dump function
2.0.0
2025-04-02 19:38 UTC
Requires
- php: >=8.2
Requires (Dev)
- phpunit/phpunit: ^9
This package is auto-updated.
Last update: 2025-07-02 20:33:21 UTC
README
Dumps information about a variable. Replacement of standard var_dump function
Installation
Install the package through Composer.
Run the Composer require command from the Terminal:
composer require faydaen/dumper --dev
Usage and samples
Dump scalar variables
Dump string
dd('hello');
Dump integer
dd(42);
Dump float
dd(3.14);
Dump bool
dd(true);
Dump null
dd(null);
Dump arrays and objects
Dump empty array
dd([]);
Dump indexed arrays (without keys)
dd(['cat', 'dog', 'horse']);
Dump associates array
dd(['planet'=>'Mars', 'hasAtmosphere'=>true, 'satellites'=>2]);
Dump object
class User { public $name; public $age; protected $someProtectedField; public function __construct (){ $this->name = 'John Doe'; $this->age = 32; } } // will be shown only public fields dd(new User());