Skip to content

Instantly share code, notes, and snippets.

@maldechavda
Last active August 11, 2016 09:16
Show Gist options
  • Save maldechavda/7890d9001cec9241fa90ce27c0580bba to your computer and use it in GitHub Desktop.
Save maldechavda/7890d9001cec9241fa90ce27c0580bba to your computer and use it in GitHub Desktop.
<?php
/**
* print_r with <pre>.
*/
function pre()
{
$args = func_get_args();
foreach ($args as $arg) {
echo '<pre>';
if ($arg instanceof Collection) {
print_r($arg->toArray());
} else {
print_r($arg);
}
echo '</pre>';
}
}
/**
* print_r with <pre> and die.
*/
function pred()
{
call_user_func_array('pre', func_get_args());
die();
}
/**
* print_r with <pre>.
*/
function ver()
{
$args = func_get_args();
foreach ($args as $arg) {
echo '<pre>';
if ($arg instanceof Collection) {
var_dump($arg->toArray());
} else {
var_dump($arg);
}
echo '</pre>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment