$http = new swoole_http_server("0.0.0.0", 9501);
$http->on("request", function ($request, $response) {
static $i;
$i++;
var_dump($i);
$response->end($i); }); $http->start();

  

http://192.168.33.10:9501/  访问

你会发现 常驻进程后静态变量不会释放,每个用户访问一次,就加一次。

[root@localhost swoole]# php time.php
^[[15~int(1)
int(2)
int(3)
int(4)
int(5)
int(6)
int(7)
int(8)
int(9)
int(10)
int(11)
int(12)

  

最新文章

  1. AFNetworking 3.0 源码解读(四)之 AFURLResponseSerialization
  2. 利用线上数据验证系统 Gor
  3. (转载)org.springframework.web.context.ContextLoaderListener
  4. Redis有序集合Zset(sorted set)
  5. 2016年11月14日--SQL创建数据库、表-查、插、删、改
  6. 查询条件Where
  7. Struts中<s:checkboxlist>的用法
  8. [Everyday Mathematics]20150117
  9. jQuery表格操作
  10. gc CMSMaxAbortablePrecleanTime
  11. 设计模式总结篇系列:享元模式(Flyweight)
  12. 【C编程基础】make命令和makefile文件
  13. 刷题之路第三题--Longest Substring Without Repeating Characters
  14. ADB命令(全)
  15. mosquitto SSL认证
  16. CentOS7安装备忘
  17. Git error: hint: Updates were rejected because the remote contains work that you do hint: not have locally
  18. o(1), o(n), o(logn), o(nlogn)算法复杂度
  19. dd-wrt 中继配置
  20. SqlServer中循环查询结果集

热门文章

  1. 自定义AQS独占模式下的同步器来实现独享锁
  2. STL(常用)
  3. js中小球碰壁反弹
  4. zookeeper服务端
  5. HTML+CSS使用swiper快速生成最简单、最快捷、最易看懂的轮播图
  6. Aop的学习与使用
  7. Java Web学习(十二)Tomcat核心
  8. Java基础一篇过(一)反射
  9. Depthwise Separable Convolution(深度可分离卷积)的实现方式
  10. Spring Cloud系列(二):Eureka应用详解