PHP V7.1下出现 Illegal string offset count(*)

发布:2017-02-25 14:28   点击:218次   回复:0
  • 问题:
  • PHP V7.1下,出现类似信息: Illegal string offset count(*)
  • 版本:所有版本,在php v7.1下出现
  • 文件:
  • /imcat/code/core/glib/glbDBObj.php
  • 方法:function count()
  • 代码
    $data="";
    $this->connect();            
    $data[`count(*)`] = $this->db->val($this->sql);
    $this->runTimer(`count`);
    return $data[`count(*)`];
    -=> 改为
    $this->connect();            
    $re = $this->db->val($this->sql);
    $this->runTimer('count');
    return $re;
  • 原因:
  • PHP V7.1下,数据类型要求严格了
  • 本处问题,$data初始化字符串,后来又设置为数组,导致出错。
状态:开放 Makedown ---   bug编号: ---
回复(0条)   >>我来回复 回复列表

关于 GitHub 导航 部门 反馈

提示:`/home.php`入口数据仅为演示功能,不构成任何交易凭证,也不承担相关风险和责任!

Copyright © 2011-2018 xxxxx.com All rights reserved.

Run:9.377/38.638(ms); 13(sql)/3.261(MB); comm:faqs/detail; Upd:2024-04-24 02:50:03