You can now make a closure from a callable by calling that callable and passing it. PHP 8.1 introduces a new syntax in creating a callable. Error: Cannot modify readonly property Post::$title First-class callable syntax $post->title = 'Some other and less fancy title' A popular analogy for an Enum is suits in a deck of playing cards. An Enumeration, or an Enum for short, is an enumerated type that has a fixed number of possible values. enum Status $post = new Post(title: ‘PHP 8.1 is available on Platform.sh’, /* … */) Versions 8.1 PHP 8.1: Enums Version 8.1 Type New Feature PHP 8.1 adds support for Enumerations. This is a feature I’ve expected for years, and I cannot wait to use it as it is such a convenient way to manage collections of constant values. And you can give them a try today on Platform.sh. Those functionalities and many more are available now. Dmitry Stogov, the author of this impressive feature, describes this as a new transparent technology that eliminates the overhead of PHP class inheritance.Īnd finally, Fibers could constitute no less than a groundbreaking shift in the PHP ecosystem by adding a low-level mechanism to manage parallelism. It also provides some nice performance improvements estimated at around 5 to 8%. PHP 8.1 comes with many new and long-expected features such as Enums, Readonly properties, First-class callable syntax, and new in initializers. While our Wikimedia servers are stuck with PHP 7.2 for a little longer, Im very much. The new PHP foundation releases a new main version every year at the very end of November, and It’s some kind of early Christmas for us developers and application makers. Just days after its official release, we are thrilled to announce the immediate availability of PHP 8.1 for all Grid plans projects.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |