生成器的核心是一个yield关键字,一个生成器函数看起来像一个普通的函数,不同的是。普通函数返回一个值,而一个生成器可以yield生成许多它所需要的值。生成器函数被调用时,返回的是一个可以被遍历的对象。
yield和return有点类似,不过不同的是,return会返回值并且终止代码的执行,而yield会返回一个值给循环调用此生成器的代码并且只是暂停执行生成器函数。

<?php
function get_one_to_three(){
for($i=1;$i<=3;$i++){
yield $i;
}
}
$generator=get_one_to_three();
var_dump($generator);
echo '<br/>';
var_dump($generator instanceof Iterator);
echo '<br/>';
foreach ($generator as $value){
  echo $value,'<br/>';
}
输出结果:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAR8AAABuCAYAAAAeXhedAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAivSURBVHhe7d1hlqI6EIZhd+iyXIpLcSm9DC9JKphUqkhA7LRz3+ccfgxCEiD1ibY6lycATED4AJiC8AEwBeEDYArCB8AUhA+AKQgfAFMQPgCmIHwATEH4AJji/fB53J6Xy+V5e8i/PT/353XZ7nr/kRUA/s++P3ykXa//x+3yvFzvT93rz/0ax10u3WP40x7P23IMp57feG2vz60mw3lc+wzbG+d61Xvc0F6/n+f9Wl63YnyduWCSfS7OTmmebJ8DHPN74fMpW/3Hx25LWRbyZDOKIEz0r70z+1C4p+JT53CVgiCf+7itdSHyOXfOu6u5fhI8RRsxnMpt4j6jYZHa652zeFw7QxN9/3D4WBPrA3cHf8WHwme7QMP5zIVeB1FWFq53F2oz+jWDpb2msZ+hCZn27W4az60XwDiqEz7p4sRnLFmaSVgUf3oWyouaJF5xyP7rYs4ENY64TZqc1b7Lsu4e260nzL7JL8pn7bCo/ddnXrWdWayjba3n5DX+dAfy2rcptuIx/fiyRfc6dvsuxqrHYi3WZdx1/oevn8yDcr2xr21P+PDS62x++FhhkYunvFrrZC0vYg6GYgJY7cm+r/2kSIz26/3ur4nQtJHEiVqtTG3rotvUjLmd6GvhG8VZdX+wrWg5xu3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xXOnyvC8AJCB8AUwyHDz8eD+BMm+GTflBMFu54AJxo/GUXbzgDONGO93x46QXgPLvCJ9398IPyAN7HnQ+AKZzwCX9WVyHDez4ATrRx56N/RJ6XWwDOs+89HwA4CeEDYArCB8AEz+d/R2UVmnSrATkAAAAASUVORK5CYII=" alt="" />
调用get_one_to_three()的时候,里面的代码并没有真正的执行,而是返回了一个生产期对象$generator=Generator Object(),$genetator instanceof Iterator说明Generator实现了Iterator接口,可以用foreach进行遍历,每次遍历都会隐式调用current()、next()、key()、valid()等方法。(Generator类中的方法)
<?php
Generator implements Iterator{
public mixed current(void)//返回当初产生的值
public mixed key(void)//返回当前产生的键
public void next(void)//生产器继续执行
public void rewind(void)//重置迭代器,如果迭代已经开始了,这里会抛出一个异常。
public mixed send(mixed $value)//向生成器中传入一个值,当前yield接收值,然后继续执行下一个yield
public void throw(Exception $exception)//向生成器中抛入一个异常
public bool valid(void)//检查迭代器是否被关闭,已被关闭返回FALSE,否则返回TRUE
public void __wakeup(void)//序列化回调
public mixed getReturn(void)//返回generator函数的返回值,PHP version 7+
}
处理大数据
​下面通过实现一个xrange函数来简单说明:
<?php
function xrange($start,$end,$step=1){
for($i=$start;$i<=$end;$i+=$step){
yield $i;
}
} foreach(xrange(1,10) as $num){
echo $num,'<br/>';
}
输出结果:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAADUAAADWCAYAAABxNspcAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAPwSURBVHhe7ZxbkuowDETZYZaVpWQpLIVl5MYPwPGjRvZlSLenT5U/Bn44JVtIipnbPiGSYkFSLEiKhX6px7Yvt3W/xz8R6ZC67+vttt/8mkHqvr5EHtsyiVSCpC5CUg5JXYSkHJK6CEmxICkWJMWCpFiQFAtGqce+Lc/5RFwrbk1hkvKl0UkiDmGW7dDFY3z7+WHMsm+AVpJKQa7Wx6R8lHCTRbdUiBBuknB0SCVjZ+B07jB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iTFgqRYmFBq3/8BAvkGUGcBBTkAAAAASUVORK5CYII=" alt="" />
上面这个xrange()函数提供了和PHP的内建函数range()一样的功能,但是不同的是range()函数返回的是一个包含值从1到10的数组,而xrange()函数返回的是依次输出的这些值得一个迭代器,而不会真正以数组形式返回。
这种方法的优点是显而易见的,它可以让你在处理大数据集合的时候不用一次性的加载到内存中,甚至你可以处理无限大的数据流。
处理大文件
​来优化下读取大文件,在PHP读取大文件的时候,经常会出现内存不足的情况,如果文件过大的话,没法一次读取完,采用yield来实现大文件的读取。
老式读取
function readLocalFile($fileName){
$handle=fopen($fileName,'r');
$lines=[];
while(!feof($handle)){
$lines[]=fgets($handle);
}
fclose($handle);
return $lines;
}
yield读取方式
function readYieldFile($fileName){
$handle=fopen($fileName,'r');
while(!feof($handle)){
yield fgets($handle);
}
fclose($handle);
}
为了便于测试,我们写一个读取内存的辅助函数
function formatBytes($bytes)
{
if ($bytes < 1024) {
return $bytes . 'b';
} elseif ($bytes) {
return round($bytes / 1024, 2) . 'kb';
}
return round($bytes / 1048576, 2) . 'mb';
}

测试

//第一种
var_dump(readLocalFile('./test.txt'));
echo '<br/>',formatBytes(memory_get_peak_usage()),'<br/>'; //第二种
$lines = readYieldFile('./test.txt');
foreach ($lines as $row) {
echo $row,'<br/>';
}
echo formatBytes(memory_get_peak_usage());

输出结果:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABZAAAADjCAYAAAAbpzGVAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAC06SURBVHhe7d2Ncas6FgDgdOiyXMIrwQ1sDy4lZXgBSRikI4x/cuMk3zfD7AsGIR0d5NyzDPm4AAAAAABAQAEZAAAAAICQAjLPOR8vHx8fl+M5//wXfXUMPk+Xw9D+4fSZd/By8nh2Pn5Msfj4OFzuSjkx/B6/fX1oxvd5OR2G/Dychv9KUs4eL1LvH/rt97v17FewNvBTyFW+le88fgp1kW/3wwrI58uxS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
总结
​使用老式读取,返回的是一个包含每行数据的数组,而yield方式则返回的是一个迭代器,而不会以真正的数组返回。
这种方法的优点是显而易见的,它可以让你在处理大数据集合的时候不用一次性的加载到内存中,甚至你可以处理无限大的数据流。

PHP学习之迭代生成器的更多相关文章

  1. ES6学习笔记<三> 生成器函数与yield

    为什么要把这个内容拿出来单独做一篇学习笔记? 生成器函数比较重要,相对不是很容易理解,单独做一篇笔记详细聊一聊生成器函数. 标题为什么是生成器函数与yield? 生成器函数类似其他服务器端语音中的接口 ...

  2. PHP迭代生成器---yield

    1.迭代生成器 生成器的核心是一个yield关键字,一个生成器函数看起来像一个普通的函数,不同的是:普通函数返回一个值,而一个生成器可以yield生成许多它所需要的值.生成器函数被调用时,返回的是一个 ...

  3. python3使用迭代生成器yield减少内存占用

    技术背景 在python编码中for循环处理任务时,会将所有的待遍历参量加载到内存中.其实这本没有必要,因为这些参量很有可能是一次性使用的,甚至很多场景下这些参量是不需要同时存储在内存中的,这时候就会 ...

  4. Python学习笔记之生成器、迭代器和装饰器

    这篇文章主要介绍 Python 中几个常用的高级特性,用好这几个特性可以让自己的代码更加 Pythonnic 哦 1.生成器 什么是生成器呢?简单来说,在 Python 中一边循环一边计算的机制称为 ...

  5. python-切片 迭代 生成器

    1 切片操作 >>> L ['aaa', 'bbb', 'ccc', 'ddd'] >>> L[0:3] ['aaa', 'bbb', 'ccc'] >> ...

  6. javascript学习笔记--迭代函数

    概要 这里的迭代函数指的是对数组对象的操作方法,js数组共有五个迭代函数:every.fifter.forEach.map.some. 1.every every方法,返回值为Boolean类型,tr ...

  7. Python学习day17 迭代器&生成器

    迭代器&生成器 1. 迭代器 1.1 迭代器 迭代:迭代是重复反馈过程的活动,其目的通常是为了逼近所需目标或结果.每一次对过程的重复称为一次"迭代" 迭代器:帮助对某种对象 ...

  8. 廖雪峰老师博客学习《通过生成器generator生成列表式杨辉三角》

    说明:这是我接触生成器概念后,自己对它的理解,可能比较表面,没深入理解,也可能有错误.后续校正错误认知,将有关generator作为一个tag了! 希望以后能活用. 先贴出自己写的triangles( ...

  9. python学习日记(生成器函数进阶)

    迭代器和生成器的概念 迭代器 对于list.string.tuple.dict等这些容器对象,使用for循环遍历是很方便的.在后台for语句对容器对象调用iter()函数.iter()是python内 ...

随机推荐

  1. Foundation-常用结构体

    复习 void test(){ struct Date{ int year; int month; int day; }; struct Date d={2015,5,14}; d.day=6; } ...

  2. mysql 运行中 偶尔 报错 2002 也许是这个问题,内存不足导致的

    配置都是正常,最终发现内存使用率高达90%多,加配置后解决问题(升级服务器配置) 加之前是2核4g ,升级配置后 4核8g

  3. sublime的一些记录

    { "keys": ["tab"], "command": "reindent", "context" ...

  4. 跨域方案JSONP与CORS的各自优缺点以及应用场景

    转自 https://www.zhihu.com/question/41992168/answer/217903179 首先明确:JSONP与CORS的使用目的相同,并且都需要服务端和客户端同时支持, ...

  5. Netty实践场景

    数据通信 如果需要考虑的是两台机器(甚至多台)怎么使用Netty进行通信.大体上分为三种: 1 第一种:使用长连接通道不断开的形式进行通信.也就是服务端和客户端的通道一直处于开启状态. 如果服务器性能 ...

  6. java课后实验性问题6

    1.继承条件下的构造方法调用. class Grandparent { public Grandparent(){ System.out.println("GrandParent Creat ...

  7. Web Service 实例基于Socket创建Web服务

    ServerSocket服务器端代码如下: public static void main(String[] args) throws IOException { // 1:建立服务器端的tcp so ...

  8. 005-log-slf4j

    一.概述 SLF4J = Simple Logging Facade for Java.     author: Ceki Gülcü     SLF4J,即简单日志门面(Simple Logging ...

  9. 从零搭建配置Cuckoo Sandbox

    1.安装依赖 $ sudo apt-get install git mongodb libffi-dev build-essential python-django python python-dev ...

  10. 图解 HTTP 笔记(二)——简单的 HTTP 协议

    本章主要以 HTTP 1.0 为例,讲解 HTTP 协议的基本结构. 在两台计算机之间使用 HTTP 协议进行通讯时,在一条通讯线路上必定有一端是客户端,另一端则是服务器端. 请求访问文本或图像等资源 ...