In this episode of “PHP Internals News” I chat with Max Semenik (GitHub) about the Non-Capturing Catches RFC that he’s worked on, and that’s been accepted for PHP 8, as well as about bundling, or not, of extensions.
The RSS feed for this podcast is https://derickrethans.nl/feed-phpinternalsnews.xml, you can download this episode’s MP3 file, and it’s available on Spotify and iTunes. There is a dedicated website: https://phpinternals.news
- Derick Rethans 0:18
Hi, I’m Derick, and this is PHP internals news, a weekly podcast dedicated to demystifying the development of the PHP language. This is Episode 58. Today I’m talking with Max Semenik about an RFC that is proposed called non capturing catches. Hello Max, would you please introduce yourself.
- Max Semenik 0:38
Hi Derick. I’m an open source developer, working mostly on MediaWiki. So that’s how I came to be interested in contributing to PHP.
- Derick Rethans 0:50
Have you been working with MediaWiki for a long time?
- Max Semenik 0:53
Something like 11 years, I guess.
- Derick Rethans 0:56
That sounds like a long time to me. The RFC that you’ve made. What is the problem that is trying to address?
- Max Semenik 1:03
In current PHP, you have to specify a variable for exceptions you catch, even if I you don’t need to use this variable in your code, and I’m proposing to change it to allow people to just specify an exception type.
- Derick Rethans 1:20
At the moment, the way how you catch an exception is by using catch, opening parenthesis, exception class, variable, and you’re saying that you don’t have to do the name of the variable any more. I get that right?
- Max Semenik 1:33
- Derick Rethans 1:34
Is that pretty much the only change that this is making?
- Max Semenik 1:38
Yes, it’s a very small, and well defined RFC. I just wanted to do something small, as my start to contributing to PHP.
- Derick Rethans 1:51
I’m reading the RFC, it states also that the what used to be an earlier RFC. How does that differ from the one that you’ve proposed?
- Max Semenik 2:00
The previous RFC wanted to also permit a blanket catching of exceptions, as in anything. And that’s all, which, understandably, has caused some objections from the PHP community. While most people commented positively on the part that I’m proposing now. Or should I say really propose because the RFC, passed and was merged yesterday.
- Derick Rethans 2:35
I had forgotten about it actually, it’s good that you reminded me. So yeah, it got merged and ready for PHP eight. Basically what you say you picked the non controversial parts of an early RFC?
- Max Semenik 2:47
I actually chose something to contribute and then looked for an RFC, to see if it was discussed previously.
- Derick Rethans 2:55
Oh, I see. So, your primary idea of wanting to contribute to PHP, instead of you having an itch that you wanted to scratch, it’s like you’re saying?
- Max Semenik 3:04
I have way larger itches that I will scratch later when I will learn how to work with PHP’s code base which, which is really huge.
Truncated by Planet PHP, read more at the original (another 11910 bytes)