• 周日. 5月 5th, 2024

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

PHP 5.6.0. Released

[db:作者]

2月 14, 2023

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.

Recap

To recap quickly:

  1. MIME types in the CLI web server have been added
  2. Internal Operator Overloading
  3. Uploads of over 2GB are now accepted
  4. POST data memory usage decreased and ::/input is reusable
  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
  9. Zip improved
  10. Importing namespaced functions and constants
  11. Exponentiation ($a = 2**3;)
  12. Default UTF-8
  13. GMP operator overloading

Regarding BC breaks, some of them include:

  1. GMP resources are now objects, which will break previous usages of is_resource
  2. mcrypt requires valid keys and IVs
  3. json_decode is more strict about upper/lower case on “true”, “false” and “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

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.

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.

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.

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.

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!

Share This Article

Bruno Skvorc

Bruno is a blockchain developer and technical educator at the Web3 Foundation, the foundation that’s building the next generation of the free people’s internet. He runs two newsletters you should subscribe to if you’re interested in Web3.0: Dot Leap covers ecosystem and tech development of Web3, and NFT Review covers the evolution of the non-fungible token (digital collectibles) ecosystem inside this emerging new web. His current passion project is RMRK.app, the most advanced NFT system in the world, which allows NFTs to own other NFTs, NFTs to react to emotion, NFTs to be governed democratically, and NFTs to be multiple things at once.

    homesteadhomestead improvednewsOOPHPPHPphp56vagrant

    const t=”undefined”!=typeof HTMLImageElement&&”loading”in HTMLImageElement.prototype;if(t){const t=document.querySelectorAll(“img[data-main-image]”);for(let e of t){e.dataset.src&&(e.setAttribute(“src”,e.dataset.src),e.removeAttribute(“data-src”)),e.dataset.srcset&&(e.setAttribute(“srcset”,e.dataset.srcset),e.removeAttribute(“data-srcset”));const t=e.parentNode.querySelectorAll(“source[data-srcset]”);for(let e of t)e.setAttribute(“srcset”,e.dataset.srcset),e.removeAttribute(“data-srcset”);e.complete&&(e.style.opacity=1)}}

    Up Next

    PhpStorm 8 Released – See What’s New and Grab a Free LicenseBruno Skvorc
    HHVM 3.1.0 ReleasedBruno Skvorc
    PHP 5.4 is Released — What’s New?Craig Buckler

    /**//**/

    [db:作者]

    相关文章

    Ubuntu下安装nginx
    nginx 配置用户认证
    windows环境下安装nginx

    发表回复

    您的电子邮箱地址不会被公开。 必填项已用*标注

    You missed