本文整理汇总了PHP中D::S方法的典型用法代码示例。如果您正苦于以下问题:PHP D::S方法的具体用法?PHP D::S怎么用?PHP D::S使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类D
的用法示例。
在下文中一共展示了D::S方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: catch
* 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>