Last active
August 11, 2016 09:16
-
-
Save maldechavda/7890d9001cec9241fa90ce27c0580bba to your computer and use it in GitHub Desktop.
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 | |
/** | |
* 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