CodeIgniter-Chinese / CodeIgniter

开源 PHP 框架 CodeIgniter 中国社区分支
http://codeigniter.org.cn/
MIT License
65 stars 26 forks source link

end(explode('.', $item)); is wrong #6

Closed hyxj1220 closed 11 years ago

hyxj1220 commented 11 years ago

database\DB_active_rec.php line 224 "return end(explode('.', $item));" is wrong .because end() param must be array &$array

chekun commented 11 years ago

explode function will return an array , if $item is a valid string. what's your point?

hyxj1220 commented 11 years ago

sorry i'm english is poor ..end() funcion must be passed by reference, not passed by value,if you do that will be display notice wrong

chekun commented 11 years ago

没事,可以搞中文啊,懂你的意思了,你说的是对的。

hyxj1220 commented 11 years ago

。。。恩 知道了

chekun commented 11 years ago

查了下源代码,开发分支已解决这个

https://github.com/EllisLab/CodeIgniter/blob/develop/system/database/DB_query_builder.php#L415

2.1分支依然是

https://github.com/EllisLab/CodeIgniter/blob/2.1-stable/system/database/DB_active_rec.php#L224

不过我用了这么久,一直没报这个错误,可能是我的php不是运行在strict mode下的 :sailboat:

hex-ci commented 11 years ago

end 必须传递引用?传递值就报个警告?我试试。。。

chekun commented 11 years ago

@CodeIgniter qq20131104-4

hex-ci commented 11 years ago

@chekun 哈哈,学习了,你回复好快