Pretty PHP dumps using highlight_string()

This is a nice little trick if you’re sick of the almost impossible to read var_dump.

function dump($data) {
    highlight_string("<?php\n" . var_export($data, true) . "\n");
}
<?php dump(['foo' => 'bar', 'baz' => 'foobar', 'status' => true]); ?>

And it should come out something like this. Nice, eh?