本文整理汇总了PHP中L::line方法的典型用法代码示例。如果您正苦于以下问题:PHP L::line方法的具体用法?PHP L::line怎么用?PHP L::line使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类L
的用法示例。
在下文中一共展示了L::line方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
/**
* Dieses Script einfach in einer CLI ausführen
* Ein Webserver ist nicht notwendig.
*
* Dieses Script demonstriert den Scalar Typ
*/
include __DIR__ . "/examples-utils.php";
$s = new \PerrysLambda\ScalarProperty("Zähn € zahme Ziegen zögen zwei Zentner Zücker zum Zoö!");
echo "\n";
L::line("Begin");
echo "\n";
L::line($s->toString());
echo "\n";
L::line("Length:", $s->length());
L::line("Begin with \"Zä\":", L::b($s->startsWith("Zä")));
L::line("Begin with \"Ze\":", L::b($s->startsWith("Ze")));
L::line("Ends with \"Zoö!\":", L::b($s->endsWith("Zoö!")));
L::line("Ends with \"Zoo!\":", L::b($s->endsWith("Zoo!")));
L::line("Last 4 chars:", $s->substr(-4));
L::line("Contains \"zögen\":", L::b($s->contains('zögen')));
L::line("Contains \"zogen\":", L::b($s->contains('zogen')));
L::line("Index of \"ö\":", $s->indexOf('ö'));
L::line("Last index of \"ö\":", $s->lastIndexOf('ö'));
echo "\n";
示例2: unset
$skiptake->each(function (OA $r) {
L::line($r->agent);
});
echo "------\n";
// sort
$orderedskiptake = $skiptake->order(function (OA $r) {
return $r->agentScalar->contains('Linux') ? 1 : 0;
})->thenBy(function (OA $r) {
return $r->agent;
})->toList();
$orderedskiptake->each(function (OA $r) {
L::line($r->agent);
});
echo "\n";
L::line("Sort by linux / not linux and useragent", $watch->stop()->result());
echo "\n";
// unset
unset($subc);
L::line("Unset \$subc.");
unset($agents);
L::line("Unset \$agents.");
unset($skiptake);
L::line("Unset \$skiptake.");
unset($orderedskiptake);
L::line("Unset \$orderedskiptake.");
unset($collection);
L::line("Unset \$collection.");
unset($grouped);
L::line("Unset \$grouped.");
L::line("Finished. Total time:", $total->stop()->result());
echo "\n";