Skip to content

Instantly share code, notes, and snippets.

@BinaryMoon
Created September 29, 2020 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BinaryMoon/93f2016fbc51c0012dd2f6e9bfad95ac to your computer and use it in GitHub Desktop.
Save BinaryMoon/93f2016fbc51c0012dd2f6e9bfad95ac to your computer and use it in GitHub Desktop.
A custom var_dump inspired
<?php
/**
* A custom var_dump that wraps the content in pre elements so it's easier to read.
* Inspired by: https://twitter.com/wpmark/status/1310870151483584514
*
* @param mixed $things A variable length list of things to be output.
* @return void
*/
function bm_var_dump( ...$things ) {
if ( ! $things ) {
return;
}
foreach( $things as $thing ) {
echo '<pre>';
var_dump( $thing );
echo '</pre>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment