Home  >  Article  >  php教程  >  3.2.3 _parseType函数有bug

3.2.3 _parseType函数有bug

WBOY
WBOYOriginal
2016-06-07 11:34:351266browse

_parseType函数有bug
protected function _parseType(&$data,$key) {
var_dump(strpos(strtolower($this->fields['_type'][$key]),'bigint'));
exit();
if(!isset($this->options['bind'][':'.$key]) && isset($this->fields['_type'][$key])){
$fieldType = strtolower($this->fields['_type'][$key]);
if(false !== strpos($fieldType,'enum')){
// 支持ENUM类型优先检测
}elseif(false === strpos($fieldType,'bigint') && false !== strpos($fieldType,'int')) {
$data[$key] = intval($data[$key]);
}elseif(false !== strpos($fieldType,'float') || false !== strpos($fieldType,'double')){
$data[$key] = floatval($data[$key]);
}elseif(false !== strpos($fieldType,'bool')){
$data[$key] = (bool)$data[$key];
}
}
}


判断条件出错了,应该是false !== strpos($fieldType,'bigint')

AD:真正免费,域名+虚机+企业邮箱=0元

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn