PHPackages                             serendipity\_hq/vardumper-cli-to-html - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. serendipity\_hq/vardumper-cli-to-html

Abandoned → [serendipity\_hq/component-var-dumper-f](/?search=serendipity_hq%2Fcomponent-var-dumper-f)ArchivedLibrary[Debugging &amp; Profiling](/categories/debugging)

serendipity\_hq/vardumper-cli-to-html
=====================================

Adds functions dumpf() and ddf() to Symfony's VarDumper component to be used in CLI scripts to dump to a file.

2.1.4(2y ago)2368MITPHPPHP ^7.4|^8.0CI passing

Since Feb 13Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Aerendir/component-var-dumper-f)[ Packagist](https://packagist.org/packages/serendipity_hq/vardumper-cli-to-html)[ Docs](https://github.com/Aerendir/component-var-dumper-f)[ RSS](/packages/serendipity-hq-vardumper-cli-to-html/feed)WikiDiscussions dev Synced yesterday

READMEChangelogDependencies (9)Versions (16)Used By (0)

 [ ![](https://camo.githubusercontent.com/5041251627a7ec1bf9335a20531d818d198f5315fc6e12d88c4694c9dcfd5bc7/687474703a2f2f7777772e736572656e64697069747968712e636f6d2f6173736574732f6f70656e2d736f757263652d70726f6a656374732f4c6f676f2d536572656e64697069747948512d49636f6e2d546578742d507572706c652e706e67) ](http://www.serendipityhq.com)

Serendipity HQ VarDumper F
==========================

[](#serendipity-hq-vardumper-f)

Adds functions `dumpf()` and `ddf()` to \[Symfony's VarDumper component\]([https://symfony.com/doc/current/components/var\_dumper.html](https://symfony.com/doc/current/components/var_dumper.html)) that write the dump to a file.

 [![](https://camo.githubusercontent.com/50e04c0da47197b5d05166ce3f933ccceb94647405582f7ccc73c859052bdcbe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736572656e6469706974795f68712f636f6d706f6e656e742d7661722d64756d7065722d662e7376673f7374796c653d666c61742d737175617265)](https://github.com/Aerendir/component-var-dumper-f/releases) [![](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT) [![](https://camo.githubusercontent.com/ec04122aad66a407f3f03175e3044791578774c9d2169e45dc618318ed844c40/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736572656e6469706974795f68712f636f6d706f6e656e742d7661722d64756d7065722d663f636f6c6f723d253233383839324246267374796c653d666c61742d737175617265266c6f676f3d706870)](https://github.com/Aerendir/component-var-dumper-f/releases)

 Supports: [![](https://camo.githubusercontent.com/152f8cb6191d2308b19e8962cbcefc2cf04a6606af6f40163c7ef74ba4499c63/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d253545342e342d3333333f7374796c653d666c61742d737175617265266c6f676f3d73796d666f6e79 "Supports Symfony ^4.4")](https://github.com/Aerendir/component-var-dumper-f/actions?query=branch%3Adev "Supports Symfony ^4.4") [![](https://camo.githubusercontent.com/eb005363bda440d1e5a2ba01ee729aac6471c5927ee5b89a9289ce09ab53fae8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d253545352e342d3333333f7374796c653d666c61742d737175617265266c6f676f3d73796d666f6e79 "Supports Symfony ^5.4")](https://github.com/Aerendir/component-var-dumper-f/actions?query=branch%3Adev "Supports Symfony ^5.4") [![](https://camo.githubusercontent.com/5ff3e72a5cdb413dcb81412c452389b639e7797910635cfebb8104c1e696809c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d253545362e302d3333333f7374796c653d666c61742d737175617265266c6f676f3d73796d666f6e79 "Supports Symfony ^6.0")](https://github.com/Aerendir/component-var-dumper-f/actions?query=branch%3Adev "Supports Symfony ^6.0")

 Tested with: [![](https://camo.githubusercontent.com/152f8cb6191d2308b19e8962cbcefc2cf04a6606af6f40163c7ef74ba4499c63/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d253545342e342d3333333f7374796c653d666c61742d737175617265266c6f676f3d73796d666f6e79 "Tested with Symfony ^4.4")](https://github.com/Aerendir/component-var-dumper-f/actions?query=branch%3Adev "Tested with Symfony ^4.4") [![](https://camo.githubusercontent.com/eb005363bda440d1e5a2ba01ee729aac6471c5927ee5b89a9289ce09ab53fae8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d253545352e342d3333333f7374796c653d666c61742d737175617265266c6f676f3d73796d666f6e79 "Tested with Symfony ^5.4")](https://github.com/Aerendir/component-var-dumper-f/actions?query=branch%3Adev "Tested with Symfony ^5.4") [![](https://camo.githubusercontent.com/5ff3e72a5cdb413dcb81412c452389b639e7797910635cfebb8104c1e696809c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d253545362e302d3333333f7374796c653d666c61742d737175617265266c6f676f3d73796d666f6e79 "Tested with Symfony ^6.0")](https://github.com/Aerendir/component-var-dumper-f/actions?query=branch%3Adev "Tested with Symfony ^6.0")

Current Status
--------------

[](#current-status)

[![Coverage](https://camo.githubusercontent.com/028d31b24817b8a7e1caa6236de5b0e51735b7cea7cfab203c5866060a5732c1/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d416572656e6469725f636f6d706f6e656e742d7661722d64756d7065722d66266d65747269633d636f766572616765)](https://sonarcloud.io/dashboard?id=Aerendir_component-var-dumper-f)[![Maintainability Rating](https://camo.githubusercontent.com/c5061683ac8c61b7af7c9f8d9320c3b83ee02b4cfed0ced285ff78973ed88a37/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d416572656e6469725f636f6d706f6e656e742d7661722d64756d7065722d66266d65747269633d7371616c655f726174696e67)](https://sonarcloud.io/dashboard?id=Aerendir_component-var-dumper-f)[![Quality Gate Status](https://camo.githubusercontent.com/6d275cc5273f7fa018a119e4f2047b078c4677c4f4d749c54c536e09ae604440/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d416572656e6469725f636f6d706f6e656e742d7661722d64756d7065722d66266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/dashboard?id=Aerendir_component-var-dumper-f)[![Reliability Rating](https://camo.githubusercontent.com/2ef097047850ece3079bd63317c54554faf81b9ee467e06e5f0f18ba5b6a6486/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d416572656e6469725f636f6d706f6e656e742d7661722d64756d7065722d66266d65747269633d72656c696162696c6974795f726174696e67)](https://sonarcloud.io/dashboard?id=Aerendir_component-var-dumper-f)[![Security Rating](https://camo.githubusercontent.com/4bc550b48b789f9e517642b7f03fd66c600077a0583ca6864d49baa684945046/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d416572656e6469725f636f6d706f6e656e742d7661722d64756d7065722d66266d65747269633d73656375726974795f726174696e67)](https://sonarcloud.io/dashboard?id=Aerendir_component-var-dumper-f)[![Technical Debt](https://camo.githubusercontent.com/35ddb4055bb51b9a506b5f9ce60b07a73428d381323b3944d3bec402b4028a3b/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d416572656e6469725f636f6d706f6e656e742d7661722d64756d7065722d66266d65747269633d7371616c655f696e646578)](https://sonarcloud.io/dashboard?id=Aerendir_component-var-dumper-f)[![Vulnerabilities](https://camo.githubusercontent.com/bae67d41e6ddb601805f4c8f14154816e5f8f250f3f0a79b5e522210d3749a1f/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d416572656e6469725f636f6d706f6e656e742d7661722d64756d7065722d66266d65747269633d76756c6e65726162696c6974696573)](https://sonarcloud.io/dashboard?id=Aerendir_component-var-dumper-f)

[![Phan](https://github.com/Aerendir/component-var-dumper-f/workflows/Phan/badge.svg)](https://github.com/Aerendir/component-var-dumper-f/actions?query=branch%3Adev)[![PHPStan](https://github.com/Aerendir/component-var-dumper-f/workflows/PHPStan/badge.svg)](https://github.com/Aerendir/component-var-dumper-f/actions?query=branch%3Adev)[![PSalm](https://github.com/Aerendir/component-var-dumper-f/workflows/PSalm/badge.svg)](https://github.com/Aerendir/component-var-dumper-f/actions?query=branch%3Adev)[![PHPUnit](https://github.com/Aerendir/component-var-dumper-f/workflows/PHPunit/badge.svg)](https://github.com/Aerendir/component-var-dumper-f/actions?query=branch%3Adev)[![Composer](https://github.com/Aerendir/component-var-dumper-f/workflows/Composer/badge.svg)](https://github.com/Aerendir/component-var-dumper-f/actions?query=branch%3Adev)[![PHP CS Fixer](https://github.com/Aerendir/component-var-dumper-f/workflows/PHP%20CS%20Fixer/badge.svg)](https://github.com/Aerendir/component-var-dumper-f/actions?query=branch%3Adev)[![Rector](https://github.com/Aerendir/component-var-dumper-f/workflows/Rector/badge.svg)](https://github.com/Aerendir/component-var-dumper-f/actions?query=branch%3Adev)

---

###  **Do you like this library?**
 **[LEAVE A ★](#js-repo-pjax-container)**

[](#----do-you-like-this-library----leave-a-)

 or run
 `composer global require symfony/thanks && composer thanks`
 to say thank you to all libraries you use in your current project, this included!

---

Install VarDumper CLI to HTML via Composer
------------------------------------------

[](#install-vardumper-cli-to-html-via-composer)

```
$ composer require serendipity_hq/component-var-dumper-f --dev

```

This library follows the  versioning conventions.

Usage
-----

[](#usage)

The library provides two functions: `dumpf()` and `ddf()`.

They work exactly like the Symfony's VarDumper built ones `dump()` and `dd()`, with those specifities:

1. Both `dumpf()` and `ddf()` can be used only in scripts that run in the command line;
2. Both requires the first parameter is `null` or an array with some options.

The simplest usage is this:

```
$var = [
    'a simple string' => "in an array of 5 elements",
    'a float' => 1.0,
    'an integer' => 1,
    'a boolean' => true,
    'an empty array' => [],
];
dumpf(null, $var);
ddf(null, $var);
```

The result will be an HTML file with a random name that contains the dump of `$var`.

Opening the file you will see

[![](docs/01-simple.png)](docs/01-simple.png)

For more examples of outputs, consult the Symfony's VarDumper documentation about [Dump Examples and Output](https://symfony.com/doc/current/components/var_dumper.html#dump-examples-and-output).

Specifying the dumped file
--------------------------

[](#specifying-the-dumped-file)

You can specify the file of the dump passing its full path name as first argument:

```
dumpf('~/path/to/your/folder/filename', $var);
ddf('~/path/to/your/folder/filename', $var);
```

You can use a name like `filename` or like `filename.html`: the resulting file will always have one `.html` extension (`filename.html`).

Passing options
---------------

[](#passing-options)

Both functions accepts as first argument an array.

The passed array can contain any of the options that you can pass to a Symfony's VarDumper Cloner ([reference](https://symfony.com/doc/current/components/var_dumper/advanced.html#cloners)).

The only additional option you can pass is the `file`, whit which you can specify the name of the dumped file:

```
dumpf(['file' => 'dump_var', 'maxDepth' => 2], $var);
ddf(['file' => 'dump_var.html', 'maxDepth' => 5], $var);
```

In both cases, the file `dump_var.html` will be generated.

What happens if the file already exists
---------------------------------------

[](#what-happens-if-the-file-already-exists)

The new dump will be added to the already existing file.

So, if you call `dumpf()` three times in your CLI script, then the resulting file dump will have three dumps in it.

If you run again the script, the resulting file dump will now contain six dumps in it: the three from the first run and the three from the second run.

To get a fresh dump, simply remove the dumped files.

---

###  **Do you like this library?**
 **[LEAVE A ★](#js-repo-pjax-container)**

[](#----do-you-like-this-library----leave-a--1)

 or run
 `composer global require symfony/thanks && composer thanks`
 to say thank you to all libraries you use in your current project, this included!

---

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance60

Regular maintenance activity

Popularity15

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~163 days

Recently: every ~281 days

Total

10

Last Release

808d ago

Major Versions

1.0.2 → 2.0.02020-02-29

PHP version history (3 changes)1.0.0PHP ^7.2

2.0.1PHP ^7.3|^8.0

2.1.2PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/dd91a553e180dea3a2e726643704e33a1d7e4c818b65ead1516ddf2f4e23ea43?d=identicon)[Aerendir](/maintainers/Aerendir)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (681 commits)")[![kodiakhq[bot]](https://avatars.githubusercontent.com/in/29196?v=4)](https://github.com/kodiakhq[bot] "kodiakhq[bot] (609 commits)")[![Aerendir](https://avatars.githubusercontent.com/u/1968622?v=4)](https://github.com/Aerendir "Aerendir (177 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (66 commits)")[![leonardofalanga](https://avatars.githubusercontent.com/u/20907369?v=4)](https://github.com/leonardofalanga "leonardofalanga (1 commits)")

---

Tags

debugdump

###  Code Quality

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/serendipity-hq-vardumper-cli-to-html/health.svg)

```
[![Health](https://phpackages.com/badges/serendipity-hq-vardumper-cli-to-html/health.svg)](https://phpackages.com/packages/serendipity-hq-vardumper-cli-to-html)
```

###  Alternatives

[symfony/var-dumper

Provides mechanisms for walking through any arbitrary PHP variable

7.4k855.5M8.0k](/packages/symfony-var-dumper)[php-debugbar/php-debugbar

Debug bar in the browser for php application

4.4k21.3M40](/packages/php-debugbar-php-debugbar)[kint-php/kint

Kint - Advanced PHP dumper

2.8k19.3M283](/packages/kint-php-kint)[xrdebug/php

PHP client library for xrDebug

23920.3k2](/packages/xrdebug-php)[phalcon/dd

This package will add the `dd` and `dump` helpers to your Phalcon application.

24294.1k27](/packages/phalcon-dd)[php-sage/sage

☯ Insightful PHP debugging assistant.

5639.7k5](/packages/php-sage-sage)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
