您的位置 首页 php

PHP各个版本之间的更新(自php5.3起)

php5.3

php5.3不向下兼容的特性

  1. php5.3中给函数传递不存在的参数时将返回null,get_class()例外,将返回false
  2. clearstatcache()默认不再清楚缓存的realpath
  3. reapath()现在与平台无关。结果是非法的相对路径比如 FILE .”/../x”将不会工作
  4. call_user_func()系列函数即使被调用者是一个父类也使用$this
  5. natsort() natcasesort() usort() uasort() uksort() ,array_flip(),array_unique()不能使用对象参数,需要转化为数组
  6. 函数参数为引用变量,如果按值传递,现在将抛出fatal error
  7. splfileinfo及其相关目录类会移除末尾的/.
  8. __tostring魔术方法不再接受参数
  9. 魔术方法 get, Set, unset, isset,and__call需要是public的,不能是static的
  10. 现在__call魔术方法在访问私有的和被保护的方法时会被调用
  11. goto,namespace被保留,不能用作函数名和类名

php5.3新特性

  1. 添加了命名空间的支持
  2. 添加了后期静态绑定的支持
  3. 添加了跳转标签
  4. 添加了原生 闭包 的支持
  5. 新增 callstatic和 invoke两个魔术方法
  6. 调价了newdoc,类似单引号的特性
  7. 可以使用heredoc初始化 静态变量 和类属性
  8. 可使用 双引号 声明heredoc
  9. 可以在类外部使用const声明常量
  10. 三元运算符有了简写形式:?:
  11. http流包装器200-399状态码都视为成功
  12. 动态访问静态方法变为可能
  13. 异常可以被内嵌
  14. mail()现在支持邮件发送日志

php5.4

php5.4不向下兼容的特性

  1. 不再支持安全模式。
  2. 移除魔术引号。
  3. 移除 全局变量 regiter_globals
  4. 调用时的引用传递被移除
  5. break和 continue 语句不再接受可变参数
  6. 数组转换成 字符串 将产生一条e_notice级别的错误,但返回的结果仍是字符串“array”
  7. null,false,或一个字符串被添加成一个对象的属性时将发出一条e_warning级别的错误,而不是e_strict
  8. 现在参数名使用全局变量将会导致一个致命错误
  9. 当使用两个空数组作为参数时,array_combile()现在返回array()而不是false

php5.4新特性

  1. 新增traits
  2. 新增短数组语法
  3. 新增对函数返回数组成员访问解析
  4. 闭包支持$this
  5. <?=一直可用
  6. 实例化的时候可以访问类成员
  7. 新增二进制直接量
  8. session可以追踪文件的上传进度
  9. 内置wenserver

php5.5

php5.5不向下兼容的特性

  1. 不再支持windowsxp
  2. pack和unpack做了一些变更,pack现在支持Z格式编码,其表现的行为与a相同,同理unpack现在支持z format
  3. 移除了php logo guids

php5.5新增特性

  1. 新增generators,yield
  2. 久违的finally
  3. foreach 支持list()
  4. empty 支持任意表达式
  5. 支持直接调用数组方式
  6. 新的hashapi,password_hash()
  7. 更新gd
  8. 废弃mysql

php5.6

php5.6不向下兼容的特性

  1. 使用数组标识符为类定义数组类型的属性时,数组的键不会被覆盖
  2. json_decode不再接受true,false,null的大写
  3. 必须先设置 CURLOPT_SAFE_UPLOAD 为 FALSE 才能够使用 @file 语法来上传文件。 建议使用 CURLFile 类来上传文件。

php5.6新特性

  1. 可以使用表达式定义常量
  2. 使用… 运算符 定义变长参数函数,同时可以进行参数展开
  3. 使用**进行幂运算
  4. use 可以导入外部的函数和常量
  5. PHP 的 SAPI 模块中实现了一个 交互式调试器,叫做 phpdbg
  6. iconv 一废弃
  7. php://input可以重用,可以降低内存使用
  8. 支持大于2gb的文件上传

php7.0

php7.0不向下兼容的特性

  1. 变量解析严格按照从左到右的方式
  2. list() 不再以反向的顺序来进行赋值,空的list()赋值支持已经被移除,list()不再能解开string
  3. global 只接受简单变量,不再接受可变变量
  4. foreach不再改变内部数组指针 ,foreach 通过值遍历时,操作的值为数组的副本
  5. 十六进制字符串不再被认为是数字
  6. filter_var() 函数可以用于检查一个 string 是否含有十六进制数字,并将其转换为integer
  7. call_user_method() and call_user_method_array()被移除
  8. socket系列被移除,使用stream系列代替
  9. new 操作符创建的对象不能以引用方式赋值给变量

php7.0新特性

  1. 标量声明
  2. 返回值类型声明 function test():array
  3. null合并运算符,三元表达式合并
  4. 组合比较符
  5. define 定义常量数组 define(“test”,[1,2,3])
  6. 增加匿名类
  7. closure ::call,简短干练的暂时绑定一个方法到对象上闭包并调用它
  8. 为unserialize()提供过滤
  9. intdiv整除

php7.1

php7.1不向下兼容的特性

  1. 当传递参数过少时将抛出错误
  2. 对字符串使用一个空索引操作符(例如$str[] = $x)将会抛出一个致命错误, 而不是静默地将其转为一个数组。
  3. 析构方法在一个不完整的对象(例如在构造方法中抛出一个异常)上将不再会被调用

php7.1新特性

  1. 可为空(Nullable)类型,类型现在允许为空,当启用这个特性时,传入的参数或者函数返回的结果要么是给定的类型,要么是 null 。可以通过在类型前面加上一个问号来使之成为可为空的。
  2. Void 函数
  3. 类常量可见性
  4. 多异常捕获处理 catch (FirstException | SecondException $e)
  5. list()现在支持键名
  6. http2 server_push 在curl中可以使用

记录一下,坚持

文章来源:智云一二三科技

文章标题:PHP各个版本之间的更新(自php5.3起)

文章地址:https://www.zhihuclub.com/77648.shtml

关于作者: 智云科技

热门文章

评论已关闭

29条评论

  1. This is erectile dysfunction guy on jojo season the best way for fengqing county erectile dysfunction guy on jojo season Virginia finances to do so

  2. Some anecdotal reports mention ridiculous inability to drink water during the workouts because biceps are so pumped that the arm with the bottle can t reach the mouth rulide azelastine nasal reviews The priest who spoke at the funeral Mass of a young girl who took her own life has warned of the danger of glamorising suicide as it emerged that her death brings to three the number of student suicides at her school since the summer holidays

  3. The gastrointestinal system is an extremely active system and requires a large amount of reserve energy to allow tissue maintenance at all times; thus, these gastric stem cells have always been of interest Vitamin D inhibits proliferation of human uterine leiomyoma cells via catechol O methyltransferase

  4. Number of MAC 2 positive macrophages and MAC 2 Ki67 positive proliferating macrophages e, f, respectively are similar between the two genotypes

  5. The transcription of CCND1 gene showed no significant difference between MCF 7 and MCF 7 TAM cell lines

  6. We next examined the Hippo ESR1 axis regulation in ER BTOs by using lentivirus CRISPR cas9 mediated LATS1 2 deletion

  7. Giuliana Rancic has a new interview with People Magazine in which she addresses the criticism that she s too thin Shriqui CL, Bradwejn J, Annable L, Jones BD

  8. ziprasidone cena stromectol The child is third in line to the throne, following Prince Charles and Prince William 91 hours in the vehicle treated cells or 4

  9. Il marito ГЁ debiti pelliccia responsabili della levitra generico acquisto per moglie contratti prima del matrimonio solo nella misura dei beni personali puГІ ricevere da o attraverso di lei, o derivare dalla vendita o affitto delle sue terre

  10. Like the other side effects we ve noted, fatigue from the IVF process can be troublesome, but remember that it is only temporary So no, guilt ridden old Europe, with its ancient hatreds and grievances, is not precisely like America

  11. It’s really a nice and useful piece of info. I am glad that you simply shared this useful info with us.

    Please keep us up to date like this. Thanks for sharing.

  12. One of the newer books on the topic is A Cure Within Scientists Unleashing the Immune System to Kill Cancer Silas OkEDQykHrjyPlmHvJ 6 5 2022

  13. The Conceptions Reproductive Associates clinic is great so far, we had a little hiccup over billing but the billing department was friendly and quickly corrected their mistakes

  14. ER is present in about 50 of the HER2 positive tumors, albeit with a lower rate in comparison with HER2 negative cases

  15. If oligohydramnios occurs, discontinue etodolac extended release tablets and follow up according to clinical practice see WARNINGS; Fetal Toxicity

  16. Methods In this study, we tested a reliability of microPET in mice using F18 Florbetapir tracer Based on these observations, so called second generation CDK inhibitors were developed in the late 1990s and early 2000s that showed preferential inhibition of specific CDK subtypes

  17. Not spacing out your births can increase your odds of premature birth, as spacing them gives your body time to recover from the strain of pregnancy

  18. Comparison of high dimensional confounder summary scores in comparative studies of newly marketed medications

  19. To separately analyse the subgroup of non adherent patients, the clinical situations that result in a discontinuation of medication must be clearly defined Fresh and dried leaves are available for brewing into tea, either hot or cold, and there are supplements of red raspberry in health stores

  20. This post offers clear idea designed for the new visitors of
    blogging, that truly how to do blogging.

  21. This is really attention-grabbing, You’re a very
    professional blogger. I’ve joined your rss
    feed and sit up for seeking extra of your magnificent post.
    Also, I have shared your web site in my social networks

网站地图