コード例 #1
0
ファイル: basic_001.php プロジェクト: lihuibin/jphp
$cursor = Flow::ofRange(5, 7);
foreach ($cursor as $el) {
    var_dump($el);
}
echo "--test range with step\n";
$cursor = Flow::ofRange(5, 10, 2);
foreach ($cursor as $el) {
    var_dump($el);
}
echo "--test string\n";
$cursor = Flow::ofString('foo');
foreach ($cursor as $el) {
    var_dump($el);
}
echo "--test string with chunk size\n";
$cursor = Flow::ofString('foobar', 2);
foreach ($cursor as $el) {
    var_dump($el);
}
?>
--EXPECT--
--test array
int(1)
int(2)
int(3)
--test range
int(5)
int(6)
int(7)
--test range with step
int(5)