![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
php7.4
桔子爱笑
这个作者很懒,什么都没留下…
展开
-
php通过反射调用私有方法
$objReflectClass = new \ReflectionClass(new NewOrderController()); $method = $objReflectClass->getMethod('getNetHeader'); $method->setAccessible(true); $header = $method->invoke(new NewOrderController());原创 2022-02-07 11:42:25 · 272 阅读 · 0 评论 -
centos7 解决php -v与phpinfo信息不一致的问题
安装lnmp环境后发现phpinfo()的版本和php -v查看的不一样赶紧看下php.ini的加载情况find / -name php.ini/usr/bin/php/opt/remi/php72/root/usr/bin/php查看cli加载的文件是哪一个?在phpinfo()中查看使用的是哪个/opt/remi/php72/php.ini这么一看就知道怎么改了vi /etc/profile//最后一行添加export PATH="/opt/remi/php72/root/u原创 2021-06-03 16:40:01 · 497 阅读 · 0 评论 -
php反射
ReflectionClass除了能获取类的信息之外,还可以,执行类内的方法<?phpclass Person { private $_allowDynamicAttributes = false; protected $id = 0; protected $name; protected $biography; public function getId() { return $this->id; } public function setId(转载 2021-04-22 16:30:13 · 73 阅读 · 0 评论 -
php实现xml和array互转 xml可带属性
class XmlTransformTools{ private static $init; private static $domObject; private $xmlContent = ''; private $arrayList = []; public static $rootName = 'DOCUMENT'; //根节点的名称 public $cdata = false; //cdata的开关 public static $转载 2021-04-16 14:59:53 · 157 阅读 · 0 评论 -
php使用pecl方式安装扩展操作示例
安装peclcd /usr/local/php/bin/wget http://pear.php.net/go-pear.phar -O go-pear.phpphp go-pear.php回车默认安装安装php扩展pecl search key-word #用于查找扩展pecl install key-word #用于安装扩展查询相关扩展[root@localhost src]# pecl search swooleRetrieving data...0%安装相关扩展pe转载 2020-06-27 21:37:53 · 204 阅读 · 0 评论 -
Array and string offset access syntax with curly braces is deprecated
Array and string offset access syntax with curly braces is deprecatedphp7.4的大坑 找到框架代码中的seq=(ord(seq = (ord(seq=(ord(value{0}) % $rule[‘num’]) + 1;改为seq=(ord(seq = (ord(seq=(ord(value[0]) % $rule[‘num’]) + 1;原创 2020-06-16 10:58:51 · 2471 阅读 · 0 评论