zoukankan      html  css  js  c++  java
  • PHP5.3--PHP7 新特性总结

    PHP5.3

    ①Added "?:" operator ( 添加了?:操作符)

    指的是三元运算符可以简写:

    $x = true;
    $rs = $x?:false;//$x?$x:false;

    ②Added lambda functions and closures

    (增加了匿名函数和闭包)

    ③Added support for namespaces

    (增加了命名空间的支持)

    PHP5.4

    ①Added short array syntax support (添加了短数组语法的支持。)

    数组可以像js那样写了[1,2,3]

    ②Added array dereferencing support.(添加了数组的延迟支持)

    数组立即调用

    ③Added class member access on instantiation support

    (对象也可以立即调用  e.g. (new foo)->bar() )

    ④<?= is now always available regardless of the short_open_tag_setting

    (短标签的支持<h1><?=$title?></h1>)

    ⑤Added binary numbers format (0b001010)

    增加二进制表示

    ⑥Added support for Traits

    PHP5.5...未完待续...

    To spare no effort to be a niubility in such a city with so so so many niubilities!!!
  • 相关阅读:
    String
    Array常用方法
    Array类
    ruby调试/练习时的小技巧
    集合类对象的遍历处理办法
    Tech road one step 7-Noc to 13-Nov
    Tech road one step 31-Oct 6-Nov
    TechRoad_oneStep_17-23 10
    TechRoad_oneStep_1001
    TechRoad_oneStep_0919
  • 原文地址:https://www.cnblogs.com/ityang666/p/php.html
Copyright © 2011-2022 走看看