PHP 5.6.0。 已发行

PHP 5.6.0., considered a very important cornerstone by many, has been released today. We’ve talked about the changes this version brings in previous posts, and others have written about it, too.

今天发布了PHP 5.6.0。,它被许多人认为是非常重要的基石。 我们已经在以前的 文章中讨论了此版本带来的更改, 其他人也对此进行了撰写。

PHP 5.6.0。 已发行

回顾 (Recap)

To recap quickly:

快速回顾:

  1. MIME types in the CLI web server have been added

    CLI Web服务器中的MIME类型已添加
  2. Internal Operator Overloading

    内部操作员超载
  3. Uploads of over 2GB are now accepted

    现在接受超过2GB的上传
  4. POST data memory usage decreased and ::/input is reusable

    POST数据内存使用量减少并且::/input可重用

  5. Improved syntax for variadic functions, functions that can accept an arbitrary number of arguments

    可变参数函数的语法得到改进,可变参数函数可以接受任意数量的参数
  6. Argument unpacking

    参数解包
  7. Constant Scalar Expressions

    常数标量表达式
  8. PHPDBG bundled by default

    PHPDBG默认捆绑
  9. Zip improved

    拉链改进
  10. Importing namespaced functions and constants

    导入命名空间的函数和常量
  11. Exponentiation ($a = 2**3;)

    求幂( $a = 2**3; )

  12. Default UTF-8

    默认UTF-8
  13. GMP operator overloading

    GMP运算符重载

Regarding BC breaks, some of them include:

关于BC休息,其中一些包括:

  1. GMP resources are now objects, which will break previous usages of is_resource

    GMP资源现在是对象,这将破坏is_resource的先前用法
  2. mcrypt requires valid keys and IVs

    mcrypt需要有效的**和IV
  3. json_decode is more strict about upper/lower case on “true”, “false” and “null”

    json_decode对“ true”,“ false”和“ null”的大写/小写更加严格

You can go into detail by reading the previous posts we wrote on these topics, or by reading the migration guide: http://docs.php.net/manual/en/migration56.new-features.php

您可以通过阅读我们在这些主题上撰写的以前的文章或阅读迁移指南来详细了解: http : //docs.php.net/manual/en/migration56.new-features.php

更新中 (Updating)

You might be wondering about update procedures – do you have to add new repos to your OS or compile from source to get them to work? What about VMs? Well, you can do that (see our old post on getting RC1 to run on Homestead, or coderabbi’s post about upgrading the current Homestead box to 5.6), but you don’t have to. Taylor Otwell has already promised to update the original Homestead box with 5.6, so you can continue to use our Homestead Improved as you always did – up and running in five minutes tops.

您可能想知道更新过程–您是否必须向操作系统中添加新的存储库或从源代码进行编译才能使它们正常工作? 虚拟机呢? 好吧,您可以做到这一点(请参阅我们有关使RC1在Homestead上运行的旧文章,或coderabbi的有关将当前Homestead盒升级到5.6的文章 ),但是您不必这样做。 泰勒·奥特威尔(Taylor Otwell)已承诺将原始的Homestead盒更新为5.6,因此您可以像往常一样继续使用我们的Homestead改良版 -只需5分钟即可启动并运行。

@bitfalls i will be upgrading it so people can just do “vagrant box update”

@bitfalls我将对其进行升级,以便人们可以进行“无用的盒子更新”

— Taylor Otwell (@taylorotwell) August 22, 2014

—泰勒·奥特威尔(@taylorotwell) 2014年8月22日

Like the man says, all you’ll need to do is run vagrant box update and your box will be refreshed with the latest version. This applies both to the original Homestead and my own Homestead Improved. It might take a while for Vagrant to redownload the box, but once done, everything should be as easy as it ever was.

就像那个人说的那样,您需要做的就是运行vagrant box update ,您的盒子将被更新为最新版本。 这适用于原始的Homestead和我自己的Homestead Improvementd 。 Vagrant可能需要一段时间才能重新下载该框,但是一旦完成,一切都应该像以往一样容易。

Note: The box has since been updated, enjoy!

注意:此框已更新,请尽情享受!

If you’d like to keep track of the original box to see when it updates, see here.

如果您想跟踪原始框以了解其更新时间,请参见此处

现在怎么办? (What now?)

So what’s next? While the internals group is working on PHPNG and PHP7, whatever those may end up being called, take the time to get familiar with PHP 5.6. If you use shared hosting, ask them to upgrade. If they don’t have plans to do so, ditch them and show them you don’t support outdatedness. Get a cheap virtual server at DigitalOcean – heck, using this link will even get you $10 which lets you host a level two server for a whole month, or a level one server for two months. That’s plenty of time to see what they offer.

下一个是什么? 当内部人员小组在研究PHPNG和PHP7时,无论最终如何调用它们,都要花点时间熟悉PHP 5.6。 如果您使用共享主机,请要求他们升级。 如果他们没有计划,那就抛弃他们,并向他们表明您不支持过时。 在DigitalOcean获得便宜的虚拟服务器 –哎呀,使用此链接甚至可以为您带来10美元的收益,该收益使您可以将一个二级服务器托管一个月,或一个一级服务器托管两个月。 足够的时间来看看他们提供了什么。

Use Heroku’s free tier to get 5.6 up and running, play around with it, explore. Step ahead of the curve by diving head first into the cutting edge and don’t let yourself be left behind by those ready to take the plunge. We’re stable, this is no longer beta or RC mode – it’s safe to upgrade, and it’ll only benefit your applications in the long run. If you’ve got some legacy code to maintain, ditch that too if it’s not compatible with 5.6.

使用Heroku的免费套餐可以启动和运行5.6,并进行试用和探索。 首先跳到最前沿,领先于弯道,不要让准备跳水的人落在后面。 我们很稳定,不再是beta或RC模式-可以安全升级,从长远来看只会使您的应用程序受益。 如果您需要维护一些旧代码,那么如果它与5.6不兼容,也可以放弃

Have you experimented with 5.6 features in a real world use case yet? Let us know in the comments below! Better yet – if you can put together advanced demos of these features, we’ll pay you for the right to publish them. Go forth, and multiply your projects!

您是否在实际用例中尝试了5.6功能? 在下面的评论中让我们知道! 更好的是–如果您可以汇总这些功能的高级演示,我们将向您支付发布这些功能的权利。 继续,并扩大您的项目!

翻译自: https://www.sitepoint.com/php-5-6-0-released/