public static function cronParse($expression = '* * *'){ $exps = explode(' ', $ex…
分类:PHP
yield
<?php function test() { for ($i = 1; $i < 10;…
反射+IOC
<?phpspl_autoload_register(function ($class) { $class = str_replace('\\', '/',…
二分查找
<?php declare(strict_types=1); function binary_search(Array $array, $search) : int…
TP6 源码阅读笔记
1、中间件 在runWithRequest中 先调用loadMiddleware 解析全局middleware.php /** * 加载全局中间件 */protected function loadMiddleware(…
笔记:自动加载与使用Closure实现private调用
自动加载 <?php // 方法1 使用__autoload魔术方法 不推荐使用 function __autoload($className){ &…
常用排序算法:冒泡排序和快速排序
冒泡排序 <?php declare(strict_types=1); $sort = [10,9,8,7,6,5,4,3,2,1]; echo "初始:".imp…
mysql优化
常用mysql工具或方法:explain、pt-query-digest配合慢查询日志 explain 索引匹配类型 按效率:const > eq_reg > ref > range > inde…
RabbitMQ 快速开始
参考: http://php-amqplib.github.io/php-amqplib/ https://www.rabbitmq.com/amqp-0-9-1-reference.html#exchange.decl…
Xdebug开启profiler的配置
zend_extension=D:/phpstudy_pro/Extensions/php/php7.3.4nts/ext/php_xdebug.dll xdebug.collect_params=1 xdebug.co…