关于PHP5.3作废函数的处置方法

php中文网
发布: 2016-06-13 10:32:04
原创
1295人浏览过

关于PHP5.3作废函数的处理方法
复制粘贴...

作废函数如下:

  call_user_method()(使用 call_user_func() 替代)

  call_user_method_array() (使用 call_user_func_array() 替代)

  define_syslog_variables()

  dl()

  ereg() (使用 preg_match() 替代)

  ereg_replace() (使用 preg_replace() 替代)

  eregi() (使用 preg_match() 配合 ‘i’ 修正符替代)

  eregi_replace() (使用 preg_replace() 配合 ‘i’ 修正符替代)

  set_magic_quotes_runtime() 以及它的别名函数 magic_quotes_runtime()

  [color=olive]session_register() (使用 $_SESSION 超全部变量替代)

  session_unregister() (使用 $_SESSION 超全部变量替代)

  session_is_registered() (使用 $_SESSION 超全部变量替代)

  set_socket_blocking() (使用 stream_set_blocking() 替代)

  split() (使用 preg_split() 替代)

  spliti() (使用 preg_split() 配合 ‘i’ 修正符替代)

  sql_regcase()

  mysql_db_query() (使用 mysql_select_db() 和 mysql_query() 替代)

  mysql_escape_string() (使用 mysql_real_escape_string() 替代)

  废弃以字符串传递区域设置名称. 使用 LC_* 系列常量替代.

  mktime() 的 is_dst 参数. 使用新的时区处理函数替代.

  处理方法:editplus编辑器中,正则替换

  替换ereg(),eregi():用preg_match替换

  ereg\("([^"]+)"替换为:preg_match("/\1/"

  ereg\('([^"]+)'替换为:preg_match('/\1/'

  eregi\("([^"]+)"替换为:preg_match("/\1/i"

  eregi\('([^"]+)'替换为:preg_match('/\1/i'

  替换ereg_replace(),eregi_replace():用preg_replace()替换

  ereg_replace\("([^"]+)"替换为:preg_replace("/\1/"

  ereg_replace\('([^"]+)'替换为:preg_replace('/\1/'

  ereg_ireplace\("([^"]+)"替换为:preg_replace("/\1/i"

  ereg_ireplace\('([^"]+)'替换为:preg_replace('/\1/i'

  如果 ereg_replace 的第一个参数不是正则表达式,可以用 str_replace 直接来替换

  split用explode替换或preg_split替换

------解决方案--------------------
"废弃以字符串传递区域设置名称. 使用 LC_* 系列常量替代"

这句说的啥?
------解决方案--------------------

探讨

"废弃以字符串传递区域设置名称. 使用 LC_* 系列常量替代"

这句说的啥?

------解决方案--------------------
貌似还有
=&使用=替换

最近刚把项目移到5.3,除了自己写的扩展不支持,其它测试下来没有任何影响,还算幸运。
------解决方案--------------------
装回5.2去吧~ 

简单的地方可以用 define 
另一些你可以把你的代码用正则替换下。
------解决方案--------------------
hmm, 明白了 

探讨

5.3.0 This function now throws an E_DEPRECATED notice if a string is passed to the category parameter instead of one of the LC_* constants.

string setlocale ( int $category , string $locale [, str……

------解决方案--------------------
学习了
相关标签:
PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号