Interface Default Methods: a PHP proposal
Brent explains a nice potential addition to PHP.
Brent explains a nice potential addition to PHP.
This feature is high on my wishlist.
Read more [sebastiandedeyne.com]
Join 9,500+ smart developers
Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.
No spam. Unsubscribe anytime. You can also follow me on X.
"Freek’s newsletter is one of the best ways to stay updated with the Laravel and PHP ecosystem. It consistently highlights useful packages, tools, and ideas from the community, especially the amazing work coming from Spatie. As a Laravel developer building SaaS and web platforms, I find it extremely helpful to discover practical tools and insights that improve my development workflow."
PHP Contributor Larry Garfield walks us through a couple of neat ideas and RFC's for PHP he's been working on. I would very much welcome a pipe operator in PHP.
Read more [peakd.com]
Ross Wintle dissected the recent RFC for auto-capturing multi-statement closures in PHP.
Read more [rosswintle.uk]
– stitcher.io - submitted by Brent
PHP 8.1 is currently in active development and will probably be released somewhere around the end of November 2021. We already know some features, changes and deprecations, so let's go through them one by one.
Read more [stitcher.io]
Exciting times in PHP land. Nikita Popov, Levi Morrison and Bob Weinand have officially proposed a concrete implementation for arrow functions.
Anonymous functions in PHP can be quite verbose, even when they only perform a simple operation. Partly this is due to a large amount of syntactic boilerplate, and party due to the need to manually import used variables. This makes code using simple closures hard to read and understand. This RFC proposes a more concise syntax for this pattern. ... Short closures are critically overdue, and at some point we'll have to make a compromise here, rather than shelving the topic for another few years.
Let's hope this one gets accepted!
Read more [wiki.php.net]
Dan Ackroyd maintains this interesting repo on GitHub with thoughts on why some PHP RFC's are not implemented yet. High on on my wishlist: Briefer closure syntax and Generics
There are some notes on PHP RFCs, why some were declined, and what others might need for them to be implemented. The purpose of these documents is to avoid information from being lost and to try to avoid conversations needing to be repeated multiple times on PHP internals.
Read more [github.com]
Nikola Poša did some light research on what features PHP developers are craving for to be added in PHP 8. Seems like I'm not the only one that wants arrow functions and generics.
It's been over two months since I started a research on Twitter about the things that developers would like to be added or improved in the next major PHP release. It had a surprisingly long reach, inspiring developers, prominent experts, community representatives to express their opinion through more than a hundred responses.
Read more [blog.nikolaposa.in.rs]
Sammy Kaye Powers, the host of the PHP Roundtable podcast, wrote a blogpost on how to compile PHP from source including unreleased RFC's. After following this tutorial you'll be able to play with the [typed properties] that are currently under discussion.
We'll be discovering and testing a completely unreleased feature of php-src from an RFC that's still under discussion. If you've ever wanted to be ahead of the curve of PHP features or you've just wanted to contribute back to PHP internals, testing an unreleased feature from an RFC is a fun and educational way to do so.
Read more [www.sammyk.me]
Frederick Vanbrabant, developer at madewithlove and co-organiser of PHP Antwerp, explains on his blog what generics are.
So everyone is talking about this hip “new” kid on the block for PHP: Generics. The rfc is on the table and a lot of people are getting all excited about it, but you don’t fully see the excitement? Let’s explore what it’s all about!
http://frederickvanbrabant.com/2017/05/31/generics-in-php.html
On the stitcher.io blog a new post appeared that explains the benefits of generics with a practical example. Generics aren't supported in PHP, but there is an RFC.
In today's blog post we'll explore some common problems with arrays in PHP. All the problems and issues listed could be solved with a pending RFC which adds generics to PHP. We won't explore in too much detail what generics are. But at the end of this read you should have a good idea as to why they are useful, and why we really want them in PHP. So without further ado, lets dive into the subject.
https://www.stitcher.io/blog/php-generics-and-why-we-need-them
When features get added to PHP there's a lot of discussion first about the new functionality. This is done on the so-called internals mailing list. You can try to follow the discussions via a rather ugly interface at http://news.php.net. The site looks like a very old school web email client where all conversations are just running through each other.
A couple of days ago Matthieu Napoli launched his new site externals.io. This site makes following internals a lot easier. Messages that are part of a conversation are grouped and thus much easier to follow. If you're interested in this you should definitely also check out Made with Love's Why We Can't Have Nice Things project that lists all RFC's and votes.
Maxime Fabre has created the best RFC tracker out there. I'll probably use his tracker more than then the official pages.
The PHP internals need to be improved, it's not new, I know it, you know it. Between the wiki, the dozens of mailing lists, the Github repository and so on, information is spread out across the web; difficult to access, to comprehend, and to participate in. If you're not familiar with it, it's an unwelcoming world to whomever might want to know more about advances in the PHP language.http://why-cant-we-have-nice-things.mwl.be/This tool aims to simplify this by unifying sources of information under one roof, and answer all the questions people might have about the PHP internals. Who voted on what? Who even are the people voting? What did they also vote on? What comments were made on a particular RFC? And so on.
Bob Weinand created a new RFC that describes how the anonymous functions could be less verbose.
This function
function ($x) {
return $x * 2;
}
could be written as one of the following
$x ~> $x * 2
$x ~> { return $x * 2;}
($x) ~> $x * 2
($x) ~> { return $x * 2; }
If it gets accepted it'll probably be added in PHP 7.1.
As you may know, the Scalar Type Wars are over. It has been decided that we will have scalar type hints in PHP7.
Here's a nice short write up on the three related accepted RFC's by Er Galvao Abbott.
On the internals mailing list Anthony Ferrara posted a plea for unity on scalar types. If you want to know why it's so difficult to add scalar type hints to PHP, you should read it.
Scalar types are a hard problem. Not technically, but politically, because so many people use PHP in different ways. And everyone thinks their way is "the one true way".http://news.php.net/php.internals/84689
The RFC needs a 2/3 majority to pass. The yes-camp currently has 67%. Personally I really hope this proposal will get accepted.
The next major release of PHP, version 7, is going to be an awesome release. Not only will performance be greatly improved, there probably will be lots of nice changes to the language.
The procedure on how PHP gets changed is easily readable and well documented. In short it comes down to this: