# PHP重点新特性

1. 文件上传进度 session.upload\_progress
2. short\_open\_tag 无论是否开启，都可用
3. 动态访问静态变量
4. 异常可以嵌套
5. const 关键字可用来在类定义之外定义常量了
6. Heredoc 结构中可以用双引号来声明标识符了
7. 添加 Nowdoc 语法支持
8. 增加 goto 操作符
9. 后期静态绑定
10. default\_charset从ISO-8859-1已经变为UTF-8
11. 新增了动态访问静态方法的方式 , 5.4
12. 内置用于开发的 CLI 模式的 web server
13. 实例化时访问类成员 (new Foo)->bar();
14. 对函数返回数组的成员访问解析 print func()\[0];
15. 新增二进制直接量 $bin = 0b110011;
16. boolval() 函数
17. 新增 array\_column() 函数
18. 直接通过下标获取访问数组和字符串字面量的元素或字符
19. empty() 支持传入一个任意表达式，而不仅是一个变量,5.3不行,5.5之後可以
20. foreach 支持 list()
21. 新增 finally 关键字
22. 新增 Traits
23. 函数返回值类型声明,标量类型声明

更多新特性，请访问我的另外一本gitbook: <https://php.shujuwajue.com/>

## 示例:

3.动态访问静态变量

```php
class C {
    public static $foo = 123;
}

$a = "C";
echo $a::$foo;
```

18.直接通过下标获取访问数组和字符串字面量的元素或字符

```php
echo [1,2,3][0]; // 1
echo 'hello world'[0]; // h
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://phper.shujuwajue.com/phpbian-ma-ji-qiao/phpzhong-dian-xin-te-xing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
