https://github.com/php/php-src/security/advisories/GHSA-8mjj...
https://github.com/php/php-src/security/advisories/GHSA-2fjv...
The other Critical CVE looks very very difficult to actually exploit, since it has to do with a very specific configuration during startup.
https://github.com/php/php-src/security/advisories/GHSA-gr4f...
https://www.aikido.dev/blog/critical-vulnerabilities-in-php-...
https://www.aikido.dev/blog/php-security-release-19-november... ( from today)
If the overhead can be further reduced (and people have ideas) then it could be that we only need ZTS mode anymore in the future and that can open up one avenue for PHP to get native async support similar to the existing parallel extension: https://github.com/krakjoe/parallel
More "hands-on" is the stream error handling improvements. This greatly improves the old file stream APIs to now allow throwing exceptions instead of returning false on errors:
$context = stream_context_create([
'stream' => [
'error_mode' => StreamErrorMode::Exception,
],
]);
try {
$config = file_get_contents('/etc/app/config.json', context: $context);
} catch (StreamException $e) {
// handle error
}Instead of let x = await func(); it's $x = yield from func();
Also ZTS is more about running in threaded servers like Apache worker or IIS, it's not about user threads.
Most code in PHP would easily run in a thread, but working in Fibers requiring a complete rewrite.
I know that introducing such a behavior by default could break existing code, but it seems relatively easy to introduce this feature in a backward compatible way by using the void type. For example :
function foo (void) {}
foo(42); // fatal error: foo() expects exactly 0 arguments, 1 given
function bar ($a, $b, void) {}
bar(1, 2, 3); // fatal error: bar() expects exactly 2 arguments, 3 given
function baz ($a, $b=null, void) {}
baz(1, 2, 3); // fatal error: baz() expects at most 2 arguments, 3 givenI was testing some PHP ~5 code in 8.3 and there was some questionable backwards compatibility decisions. eg methods that previously returned true / false to indicate success now threw errors, same message signature and all.
A poster phrased it well on here recently¹: "in general lots of users being on unsupported releases should also cause some reflection why that is. E.g. maybe support periods are too short or there are too many breaking changes with new releases."
Specifically because older versions of PHP didn't have "..." arguments - variadic functions used func_get_args() to access their arguments.
I'd love to upgrade to 8.6 so I can use function partials!
It was a smart decision to roll it out incrementally but it did create a weird gap there for a little bit but they did do it so kudos to the team.
1. The chosen example is for PHP versions. That might just be the example but this sort of thing is a real problem. Personally I prefer something like the polyfill method as seen in Javascript where possible. Python has to deal with this too since it seems like every 3.x release now makes breaking changes. That might be just be their trivial example; or
2. Closures. Looking at the linked doc that seems to be a use case. PHP suffers here (IMHO) from having a really poor type system. Having closure arguments as question marks seems... inelegant. I'd really prefer to be able to type those and also know that the variable I have itself is a callable of some kind. I always point to the Hack type system as a comparison here.
So I dislike the name "partial function arguments" because it's unclear what the purpose is. If they're closures, call them closures. If PHP's PFA's can't bind variables (I didn't look into whether they could or not, call them something else?
The word "partial" here is really what I'm having issue with. I'm reminded of partial classes from C#, which solved a problem of creating part of a class from, say, a config file. The first example I saw was WPF using XML to define UI elements where the framework compiled the XML into partial classes and you had to fill out the rest for it to compile. I guess it's a bit like declaring a header and then failing to link an implementation (in the C/C++ world).
The PHP team announced that they're going to release a critical fix between 14:00 and 14:30 UTC today. Doesn't say whether 8.6 is affected too, but the vulnerability is probably at the top of their mind right now -- even more so than the 8.6 release.
The old approach of out-pacing adversaries though mutation rates is over, given an entire FOSS code-audit looking/fuzzing for 0-days can now be done in under a day. In retrospect, over 700 reported LPE and 280 kernel CVE were dropped in the past 3 months from "LLM". This is not going to stop anytime soon.
To be honest, its very nostalgic as kids would clown each others servers in the early days. Ultimately leading to a more robust OS for everyone. =3
So I’m not sure what you mean by “before you get excited”? This is their normal release cycle, not some new emergency patch release. Although based on recent events, I see how this could be confused.
I'd say this sounds pretty serious.
The parent comment seemed to be mistaking this for another unplanned security release like we had recently for the 2 RCE vulnerabilities.
I've always viewed PHP as having these ideal features:
1. A stateless functional core. It's cheap to run and quick to start. Compare this to Java or even Python. There's no loading a bunch of class libraries;
2. Every request has an environment created then torn down. That means it's hard for a given request handler to leak memory or other resources. You compare this to, say, Java's servlet API (which only really existed because the startup costs were too high) where resource leaking is a real problem and then you get into GC and STW pauses; and
3. Every request is single-threaded. This is ideal. Async network/IO requests are handled via extensions. You should never need to spawn a thread in a request handler directly. You eliminate a whole class of bugs by doing this.
Is PHP perfect? No. The class separator as the backslash still offends me more than a decade later. I really wish Facebook's Hack had become PHP because it's got a vastly better type system, core collection classes (list, vec, dict) and it did things a decade ago that PHP is only added with this release (eg polling).
As for partial functions, the use case seems to be versioning? I actually prefer the Javascript polyfill method here where possible. Don't make users care about this kind of stuff.
1. more complex to use (it took years for some parsers to implement the PHP 8.4 property hooks, and I suppose few people can explain how they work with inheritance and traits), 2. more costly to maintain (I remember when the developer of PHP's JIT left, the PHP foundation was worried because no one could understand the JIT code), 3. and has more security risks (critical security releases will continue).
I don't disagree with you, but the situation is more nuanced, and PHP's initial promises are now blurred.
> 1. A stateless functional core. It's cheap to run and quick to start.
Most modern codebases use a framework. And once you have to load Wordpress, Drupal, or even worse, Laravel, then it's no longer cheap and quick. So PHP added several layers of complexity to mitigate this: an opcode cache, a code-preload system...
> 2. Every request has an environment created then torn down.
That's no longer always true. When the code preload is enabled, a request can leak into another.
> 3. Every request is single-threaded. [...] Async network/IO requests are handled via extensions.
You mixing up two different things. The default PHP SAPIs have single-threaded request handlers (though IIRC the default deploy stack of Laravel differs). But the language has a native async feature through Fibers, from which coroutines can be implemented (see amphp/amp).
So PHP on the server side is usually like JS on the client side (except for workers): single-threaded with async. Though I haven't seen much use of Fibers in the wild, it's in the language.
The frameworks aren't slow: https://tideways.com/profiler/blog/php-benchmarks-8.6-vs-8.5...
The last round of TechEmpower web benchmarks computed the framework overhead. Depending on the task, the performance of Laravel was 5% to 20% of the native PHP code, i.e. 5 to 20 times slower. Source : https://www.techempower.com/benchmarks/#section=data-r23&tes...
That's in the same bucket (to me) as, say, L1/2/3 cache leaking between CPU threads. That's resulted in real attacks but it's not really the fault of my programming. I would rather the bug be in the language or the compiler/interpreter or even the framework because it's more likely to get found and fixed than if it was only code written by me for me.
As an aside, PHP eliminates a whole class of bugs that don't exist in, say, C/C++ eg string buffer overflows. Yes, the PHP engine can itself have buffer overflows but as per my previous point I trust the library developers and the volume of people who use and analyze it more than being totally correct with my own string handling.
> But the language has a native async feature through Fibers, from which coroutines can be implemented (see amphp/amp).
Only a single fiber runs your PHP request at any one time. This still fits the same model.