Interface Default Methods, Wordpress and PHP 5, and more
🐘 PHP Internals
[RFC] Interface Default Methods
This proposal for the next PHP will allow us to add the implementation to a method inside an Interface, if we want.
interface Example {
// Today, you cannot specify an implementation, only a
// signature.
function method1(): void;
// With this RFC, you can provide an implementation:
function method2(): void {
echo __METHOD__, "\n";
}
}Currently is in the voting status, and it seems that it’s going to be rejected.
What do you think, do you like it or do you think that it’s a step backward?
🤷♂️ Misc
🎏 My site has been blocked by ad blockers
About 65 million people are currently using ad blockers and, MetricsWave, a Google Analytics and Amplitude alternative, has recently been added to the block lists and making the home page and web application inaccessible. What can be done in this case?
🎉 WordPress is dropping support for PHP 5
Support for PHP 5 will be dropped in WordPress 6.3, scheduled for release on August 8th 2023. The new minimum supported version of PHP will be 7.0.0. The recommended version of PHP remains at 7.4 or greater.
Also they are proposing to remove the “beta” label for PHP 8.0, 8.1 and 8.2.
🖥️ Native PHP
Is a Laravel package designed to enable developers to build desktop applications using PHP and harness the power of native system APIs. According to Marcel Pociot, it will become publicly available at Laracon US on July 20. Would you use it?
📦 TermAsteroids
An Asteroids-like game, running in a terminal, written in PHP.
PHP wishlist: Nested Properties
Sebastian De Deyne proposed nested properties for PHP. It's something similar to what we can do in TypeScript, but for PHP. Sometimes, we do this using multiple objects, but this is a simpler approach. I'm not sure if I like it or not.
public function __construct(
public int $id,
public string $name,
public string $email,
public $endpoints: (
string $index,
string $store,
string $update,
string $delete,
),
) {
}

