rfc:final_by_default_anonymous_classes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:final_by_default_anonymous_classes [2024/01/15 10:35] danogrfc:final_by_default_anonymous_classes [2024/02/06 19:51] (current) – Move to declined ilutov
Line 2: Line 2:
   * Date: 2023-12-23   * Date: 2023-12-23
   * Author: Daniil Gentili <daniil@daniil.it>   * Author: Daniil Gentili <daniil@daniil.it>
-  * Status: Voting+  * Status: Declined
  
 ===== Introduction ===== ===== Introduction =====
Line 41: Line 41:
 Rationale regarding ''open'': Rationale regarding ''open'':
  
-On one hand, looking at code like ''new class {}'', you would assume that since the class apparently has no name, it should not be impossible to extend it, but on the other hand, there are valid usecases for extending even anonymous classes (comments in the PR (https://github.com/php/php-src/pull/11126 referenced proxying), I can think of phpunit mocking to a much, much lesser extent given that you should realistically (hopefully) never have to mock an anonymous class that does not already implement an interface), and completely precluding the possibility of extending a class that+On one hand, looking at code like ''new class {}'', you would assume that since the class apparently has no name, it should not be impossible to extend it, but on the other hand, there are valid usecases for extending even anonymous classes (comments in the PR (https://github.com/php/php-src/pull/11126 referenced proxying), and I can also think of phpunit mockingcompletely precluding the possibility of mocking a class that
  
   - Has a name (even if it's not immediately obvious)   - Has a name (even if it's not immediately obvious)
Line 74: Line 74:
 2/3 required to accept. 2/3 required to accept.
  
-<doodle title="Make final anonymous classes final by default?" auth="danog" voteType="single" closed="false" closeon="2024-01-30T00:00:00Z">+<doodle title="Make final anonymous classes final by default?" auth="danog" voteType="single" closed="true" closeon="2024-01-30T00:00:00Z">
    * Yes    * Yes
    * No    * No
Line 82: Line 82:
 2/3 required to accept. 2/3 required to accept.
  
-<doodle title="Add an optional open keyword for anonymous classes?" auth="danog" voteType="single" closed="false" closeon="2024-01-30T00:00:00Z">+<doodle title="Add an optional open keyword for anonymous classes?" auth="danog" voteType="single" closed="true" closeon="2024-01-30T00:00:00Z">
    * Yes    * Yes
    * No    * No
rfc/final_by_default_anonymous_classes.1705314946.txt.gz · Last modified: 2024/01/15 10:35 by danog