Table of Contents
1. 支持Unicode
2.Register Globals 将被移除
3.Magic Quotes 将消失
4.Safe Mode 取消
5.‘var’ 别名为 ‘public’
6.通过引用返回将出错
7.zend.ze1 compatbility mode 将被移去/Zend.ze1相容模式将被移去
8.Freetype 1 and GD 1 support 将不见
9.dl() 被移到 SAPI 中
10.Register Long Array 去除
11.一些Extension的变更
12.APC将被导入核心
13.告别ASP风格的起始标签
Home php教程 php手册 PHP 6与PHP 5相比的那些变化与改进

PHP 6与PHP 5相比的那些变化与改进

Jun 13, 2016 am 09:39 AM
trend

PHP 6 出了好些年了,虽然现在普遍用的还是 PHP 5,但是毕竟PHP 6还是未来的趋势。那么PHP 6对于 PHP 5来说,有什么变化,有哪些地方改进了呢?

1. 支持Unicode

支持Unicode是有其必然,虽然Unicode占用较多的空间,但Unicode带来的便利性,远超过占用空间的缺点,尤其在国际化的今天,硬件设备越来越强大,网速也大幅度的提升,这么一点小小的缺点是可以忽略的。

另外一点,PHP也可以在.ini文件中设定是否开启支持Unicode,决定权在你自己,这是一个不错的点子,关掉Unicode的支持,PHP的性能并不会有大幅度的提升,主要的影响在于需要引用字符串的函数。

2.Register Globals 将被移除

这是一个重要的决定,说多新进的PHP开发者会觉得Register Globals满方便的,但是却忽略了Register Globals会带来程序上安全性的隐患,大多数的主机上此项功能是关闭的,印象中从PHP4.3.x版开始时,此项默认设置值即是关闭状态,PHP6正式移除Register Globals也代表着如果程序是由PHP3时代的产物,将完全无法使用,除了改写一途外,别无他法。相信现在的PHP世界里,仍使用PHP3时代所产生的程序应该是少之又少。

3.Magic Quotes 将消失

Magic Quotes主要是自动转义需要转义的字符,此项功能移除也符合大多数PHP开发者的心声。

4.Safe Mode 取消

老实说,这个模式不知道哪里不好,取消就取消吧,反正也用不到。

5.‘var’ 别名为 ‘public’

在类中的var声明变成public的别名,相信是为了兼容PHP5而作的决定,PHP6现在也可以称作为OO语言了。

6.通过引用返回将出错

现在透过引用返回编译器将会报错。例如$a =& new b()、function &c(),OO语言默认就是引用,所以不需要再使用&了。

7.zend.ze1 compatbility mode 将被移去/Zend.ze1相容模式将被移去

PHP5是为兼容旧有PHP4,所以在.ini中可选择是否开启相容模式,原因在于PHP5使用的是第二代解析引擎,但是相容模式并不是百分之百能解析PHP4语法,所以旧时代的产物,移除。

8.Freetype 1 and GD 1 support 将不见

这两个是很久的Libs,所以不再支持,GD1早已被现在的GD2取代了。

9.dl() 被移到 SAPI 中

dl()主要是让设计师加载extension Libs,现在被移到 SAPI 中

10.Register Long Array 去除

从PHP5起默认是关闭,再PHP6中正式移除。

11.一些Extension的变更

例如 XMLReader 和 XMLWriter 将不再是以Extension的方式出现,他们将被移入到PHP的核心之中,并且默认是开启,ereg extension将被放入PECL,代表着它将被移出PHP核心,这也是为了让路给新的正则表达式extension,此外,Fileinfo extension 也将被导入PHP的核心之中。

12.APC将被导入核心

这是一个提高PHP性能的功能,现在它将被放入PHP核心中,并且可以选择是否启用APC

13.告别ASP风格的起始标签

原来是为了取悦ASP开发者转向使用PHP,现今已经不再需要这种做法了,最后,别期望PHP6的性能可以全面超过PHP5,有可能的是PHP6的执行效率会比PHP5还要来的慢的,但是可以预期的是,PHP开发小组将会努力的完善PHP 6,超越PHP 5。

Statement of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1272
29
C# Tutorial
1252
24
Explore the development trend of Go language GUI: the direction of future interface programming Explore the development trend of Go language GUI: the direction of future interface programming Mar 22, 2024 pm 01:42 PM

As a rapidly developing programming language, Go language has been widely used in many fields. In terms of interface programming, although there have always been relatively few GUI libraries in the Go language, as more and more developers have increased demand for interface design, the GUI in the Go language has also begun to quietly rise. This article will explore the development trend of Go language GUI, analyze the future direction of interface programming, and provide specific code examples. 1. The development status of Go language GUI. At present, the GUI libraries of Go language mainly include Walk, ui, Lo

Open source development trends of Go language Open source development trends of Go language Mar 07, 2024 pm 03:33 PM

Go language (Golang), as an emerging programming language, has attracted much attention since its birth. It was developed by Google and first released in 2009, and quickly gained recognition and love from programmers in a short period of time. The Go language was originally designed to improve programmer productivity. It combines the performance and convenience of static languages ​​with the flexibility of dynamic languages, allowing developers to write various types of applications more efficiently. Due to its simplicity, efficiency, and ease of learning, the Go language has gradually become a

Analysis of real-time hot spots and trend functions of PHP social media applications Analysis of real-time hot spots and trend functions of PHP social media applications Aug 09, 2023 pm 01:09 PM

Analysis of real-time hot spots and trends in PHP social media applications With the development of social media, more and more people are paying attention to real-time hot spots and trends. These functions can help users understand the hottest topics and the most popular content at the first time. In this article, we will explore how to develop real-time hot spots and trending features for social media applications using PHP and provide some code examples. 1. Implementation of the real-time hotspot function The real-time hotspot function refers to the ability to display the most popular topics within a period of time based on user interests and current hot topics.

What are the innovation trends in the Go framework? What are the innovation trends in the Go framework? Jun 04, 2024 pm 02:43 PM

Innovation trends in the Go framework include: microservices and service mesh (such as Istio and Linkerd), serverless computing (such as AWS Lambda and Google Cloud Functions), GraphQL (such as ApolloServer), and event-driven architecture (EDA) (such as NATS and Kafka).

What is the future of Java functions? What are the new technologies and trends? What is the future of Java functions? What are the new technologies and trends? Apr 29, 2024 am 11:18 AM

Java functions are constantly evolving with the emergence of new technologies such as serverless computing, Kubernetes, GraalVMNativeImage, and Quarkus. These technologies bring the following benefits: Serverless computing: Reduce costs, increase scalability, and simplify development and deployment. Kubernetes: Improves portability, simplifies deployment and management, and provides automatic failover and self-healing capabilities. GraalVMNativeImage: Significantly improves startup time, reduces memory overhead, and improves performance. Quarkus: Lightweight and scalable, works out-of-the-box in serverless environments and provides full-stack development capabilities.

Python development advice: Learn and apply the latest development techniques and trends Python development advice: Learn and apply the latest development techniques and trends Nov 22, 2023 pm 08:30 PM

Python is a programming language widely used in various fields. As time goes by, Python's development continues. In order to be able to better cope with the growing needs and higher requirements, as a Python developer, we should learn and apply the latest development technologies and trends. First, it is necessary to understand the latest Python development trends. The Python community is constantly innovating and improving, so you want to stay updated. Follow Python’s official website and follow Python’s community

Golang remote work trends and future prospects. Golang remote work trends and future prospects. Mar 05, 2024 pm 09:12 PM

Golang remote work trends and future prospects With the continuous development of Internet technology and the acceleration of globalization, remote work has become the choice of more and more programmers and IT practitioners. As an efficient, flexible and unrestricted way of working, remote working has been widely used in all walks of life. In this wave of development, Golang, as a rapidly developing programming language, has gradually become the first choice for many remote jobs. Golang, also known as Go language, was developed by Google

Is the relationship between Google and Golang gradually estranged? Analyze industry trends Is the relationship between Google and Golang gradually estranged? Analyze industry trends Mar 06, 2024 am 08:45 AM

With the rapid development and continuous transformation of information technology, major technology companies are constantly adjusting their business focus to adapt to market needs and industry trends. The relationship between Google and Golang has also seen some changes in recent years, and there are some signs that the relationship between the two is gradually becoming distant. Next, we will analyze this phenomenon from several aspects. First of all, Golang, as a programming language, has gradually emerged in recent years and is favored by more and more developers. Golang’s simplicity, efficiency, and powerful concurrency performance

See all articles