phptools-docs
phptools-docs copied to clipboard
PHP 8.4 Object Interfaces not supported?
Sorry if this has been already addressed.
Seems that Object Interfaces are not supported. The extensions show no errors, you get a fatal error:
interface I
{
// An implementing class MUST have a publicly-readable property,
// but whether or not it's publicly settable is unrestricted.
public string $readable { get; }
// An implementing class MUST have a publicly-writeable property,
// but whether or not it's publicly readable is unrestricted.
public string $writeable { set; }
// An implementing class MUST have a property that is both publicly
// readable and publicly writeable.
public string $both { get; set; }
}
// This class fails in implementing the interface
class C1 implements I
{
}
Good point @gremo ,
We support object interfaces of course, but we don't check that the interface property is implemented by its class (so there is no warning in problems window).
Will be implemented!
@jakubmisek Yes, of course — I meant that no error is reported. Thanks, and as always, great job and thanks for the speed with which you handle issues!
@gremo thank you, we'll try to add property checks on interfaces in future update!