使用PhpStorm2024.3版本,插件更新至最新版,插件配置如下
当使用pdo查询时且存在WHERE条件时,且上下文中存在较多变量,手动写好两三个WHERE条件后,触发自动补全时有概率触发一个类似“陷入死循环”的状态不断补全代码,例如:
$id = '1';
$sex = 'boy';
$age = '22';
$addr1 = 'xxx';
$addr2 = 'yyy';
$pdo->prepare("SELECT email FROM records WHERE id = :id AND sex = :sex AND age = :age");
#写到这里时会触发补全,但是会补全成这样:
$pdo->prepare("SELECT email FROM records WHERE id = :id AND sex = :sex AND age = :age AND addr1 = :addr1 AND addr2 = :addr2 AND sex = :sex AND age = :age AND addr1 = :addr1 AND addr2 = :addr2 AND sex = :sex AND age = :age AND addr1 = :addr1 AND addr2 = :addr2 AND sex = :sex AND age = :age AND addr1 = :addr1 AND addr2 = :addr2 AND sex = :sex AND age = :age AND addr1 = :addr1 AND addr2 = :addr2 AND sex = :sex AND age = :age AND addr1 = :addr1 AND addr2 = :addr2");
# 就这样循环下去好多
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。