Created
September 29, 2020 19:40
-
-
Save BinaryMoon/93f2016fbc51c0012dd2f6e9bfad95ac to your computer and use it in GitHub Desktop.
A custom var_dump inspired
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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