Skip to content

Conversation

@LeonMelis
Copy link
Contributor

PECL's DS classes cannot be extended, as they are optimized C implementations.

Attempting to extend a DS class causes PHP to emit a fatal error:

PHP Fatal error:  Class MyVector cannot extend final class Ds\Vector

However, PHPStorm won't warn about this, because the stubs don't specify these classes as being final.

The official PECL DS polyfill (see: https://github.com/php-ds/polyfill/tree/master/src) does use the final keyword for the class definitions.

This PR adds the final keyword to the PECL DS class stubs, so that PHPStorm's code inspection correctly warns about attempting to extend a PECL DS class.

PECL's `DS` classes cannot be overridden
@isfedorov isfedorov merged commit e999814 into JetBrains:master Jan 9, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants