Perhaps a little too late, but I was wondering whether folks that voted NO
would reconsider in case this was made a bit more opt-in.

There could be some bikesheding around syntax but essentially the idea
would be a new RFC targeting 8.4 with the following adjustment:

interface Foo {
    public function bar() {
        echo "hello";
    }
}

class Out implements Foo {}

// RFC is ignored.
// Fatal error: Class Out contains 1 abstract method and must therefore be
declared abstract or implement the remaining methods (Foo::bar)

class In use Foo {}

// RFC takes effect.

class In extends Foo {}

// RFC takes effect but the class is no longer allowed to extend abstract
classes, only interfaces

class In with Foo {}

// RFC takes effect

class In as Foo {}

// RFC takes effect

==========

In the spirit of minimizing impact, the proposed syntaxes only use keywords
already present in the language as to not run the risk of causing more
issues (https://www.php.net/manual/en/reserved.keywords.php).

This idea occurred to me when someone pointed out that they don't want to
implement interfaces which might bring code into their class.
Does this adjustment makes things better, worse or the same?

Reply via email to