首 页   · 站长博客 · 用户注册 · 会员登陆  · 会员排行  ·最新主题  ·最近回复  精华区  版权声明  ·论坛管理
  当前登录身份:游客,请先登录。  笔名: 口令: 验证码:   
楼 主  index »  PHP与模板与代码加密/优化 » [转帖] Migrating from PHP 4 to PHP 5  


  作者:一起PHP
  注册时间:2004-02-27
  主题/回复:247/1521
  积分:4649
  等级:★★★★★☆(十一级)
  称号:论坛圣人

  nqp@nqp.me
  4304410
  www.nqp.me

 

 发表:2005-04-23 00:38:54 阅读 1965 次 回复 1 次 得分0  |   字号 字色
[转帖] Migrating from PHP 4 to PHP 5
关于PHP5与PHP4区别的问题
从PHP官方网站找到的资料,看起来还不错,涉及到从PHP4到php5升级的一些问题,比如mysql和php5的结合性问题,php5的全新的OOP(面向对象)问题等。由于翻译比较费劲,直接贴过来,大家看看,看懂一点是一点,总有收获。
如果有能力的朋友,能帮忙翻译一下,那就利国利民拉~!
---------------------------------------------
This faq section will help you migrate from PHP 4 to PHP 5. 

1. Migrating from PHP 4 to PHP 5 
2. Does MySQL work in PHP 5? It seemed to have disappeared. 
3. I hear PHP 5 has an entirely new OOP model, will my existing OOP code work? Where do I find information on these new OOP features? 
4. So besides the new OOP model, what else has changed in PHP 5.Also, is there a PHP 5 specific version of the PHP manual? 
----------------------------------------------
1. Migrating from PHP 4 to PHP 5 

Although PHP 5 offers many new features, it's designed to be as compatible with earlier versions of PHP as possible with little functionality being broken in the process. 

Be sure to read the appropriate PHP 5 migration appendix of this manual as it contains even more information on the topic of migrating to PHP 5. 

2. Does MySQL work in PHP 5? It seemed to have disappeared. 

MySQL is supported with the only change being that MySQL support is no longer enabled by default in PHP 5. This essentially means that PHP doesn't include the --with-mysql option in the configure line so that you must now manually do this when compiling PHP. Windows users will edit php.ini and enable the php_mysql.dll DLL as in PHP 4 no such DLL existed, it was simply built into your Windows PHP binaries. 

Also, the MySQL client libraries are no longer bundled with PHP. More details on this topic are covered in the following FAQ and be sure to read the MySQL section for details on installing MySQL. An example configure line would be --with-mysql=/usr while Windows users will need the libmySQL.dll available to the system. 

3. I hear PHP 5 has an entirely new OOP model, will my existing OOP code work? Where do I find information on these new OOP features? 

The main change in PHP 5 is to the OOP model as PHP 5 now uses the Zend Engine 2.0. The zend.ze1_compatibility_mode directive enables compatability with the Zend Engine 1.0 (PHP 4). 

The new OOP model is documented in the OOP language reference and OOP migration appendix sections. 

4. So besides the new OOP model, what else has changed in PHP 5? Also, is there a PHP 5 specific version of the PHP manual? 

Few other changes exist, see the migration 5 appendix for details. There won't be a PHP 5 specific version of the manual as the bulk of PHP remains the same. 
 
 1#楼  
 
  回复人:一起PHP
  注册时间:2004-02-27
  主题/回复:247/1521
  积分:4649
  等级:★★★★★☆(十一级)
  称号:论坛圣人

   
 1#楼 发表于2005-04-23 00:47:18  评分:× 

补充一条:
 有的朋友可能标题都看不懂,标题的意思是:从PHP4移植到PHP5
  页数1/1首页 « 1 » 末页
  发表回复:您还没有登陆,无法发表回复。请先[登陆]

一起PHP技术联盟 主办:一起PHP 联系方式:站长QQ:4304410 QQ群:8423742 20159565 站长博客 E-mail: nqp@nqp.me 执行时间:0.003sec
SimsmaBBS 2008 (v6.0) Developed by 17php.com,Copyright(C)2003-2010 All rights reserved. 副本授权:一起PHP官方专用版