Skip to content

Instantly share code, notes, and snippets.

@infn8
Last active August 29, 2015 14:02
Show Gist options
  • Save infn8/24b4c90ddff1abfb050b to your computer and use it in GitHub Desktop.
Save infn8/24b4c90ddff1abfb050b to your computer and use it in GitHub Desktop.
Var Dump Helper Function and sublime caller snippet
<?php
function var_pre($var, $msg = NULL){
/*
Helper Function:
Use *instead of* var_dump();
will output var_dump wrapped with <pre></pre> and give an optional 2nd param for a message.
*/
echo "\n<pre>";
if($msg !== NULL){
echo "\n".$msg."\n";
}
var_dump($var);
echo "</pre>\n";
}
?>
<snippet>
<content><![CDATA[
var_pre(\$${1:var}${2:, "${1:msg}"});
]]></content>
<tabTrigger>varpre</tabTrigger>
</snippet>
@kgibs
Copy link

kgibs commented Jun 19, 2014

hey dork. you forgot a curly brace!

@infn8
Copy link
Author

infn8 commented Jun 19, 2014

Looks like I did. Fixed now. Thanks beautiful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment