示例#1
0
文件: misc.php 项目: aronduby/dump
 *		D::KILL 	kills execution of PHP after printing the output (InvalidArgumentException thrown if used with D::OB)
 *		D::EXPAND 	expands everything by default
 */
$str = D::ump(['foo' => 'bar'], D::S(D::OB, 'D::OB Flag'));
print '<p>this should be before the output</p>';
print $str;
// The D::EXPAND flag
D::ump($a, D::S(D::EXPAND, 'Expanded Values by Default'));
// Variable length arguments
D::ump('likes', 'kittens', 'and', 'dogs', D::S(0, 'Passing Multiple Arguments'));
// You can globally enable and disable output
D::ump(D::enabled(), D::S(0, 'enabled?'));
D::ump(D::disabled(), D::S(0, 'disabled?'));
D::disable();
D::ump('you shouldn\'t see this');
D::enable();
// Passing in D::KILL and D::OB will result in a InvalidArgumentException since you can't do both
try {
    D::ump('test', D::S(D::KILL | D::OB));
} catch (InvalidArgumentException $e) {
    D::ump($e, D::S(0, 'Caught the InvalidArgumentException form D::KILL | D::OB'));
}
// lots of expanding
D::ump((object) array('a' => array('b' => array('c' => array('d' => array('e' => null))))), D::S(0, 'Long Object Example'));
D::ump($a, D::S(D::KILL, 'D::KILL, there\'s a message below you shouldnt see'));
print "<p>If you see this something is broken</p>";
?>
</body>
</html>