Re: RFC: short and inner classes

From: Date: Thu, 06 Mar 2025 21:00:42 +0000
Subject: Re: RFC: short and inner classes
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-126607@lists.php.net to get a copy of this message
Hi On 3/6/25 20:08, Niels Dossche wrote:
What I'm less in favor of is the implementation choice to expose the inner class as a property/const and using a fetch mode to grab it. That feels quite weird to me honestly. How did you arrive at this choice?
Somewhat relatedly, the RFC does not mention how the choice of :: as the separator interacts with the following features (i.e. what will the result of each of the statements be):
    Closure::fromCallable('Outer::Inner::method');
    new ReflectionMethod('Outer::Inner::method');
    defined('Outer::Inner');
    constant('Outer::Inner');
    $inner = 'Inner';
    Outer::{$inner};
… and any other meta-programming functionality working on class constants or static methods. Also, what will happen for:
    class P {
        class Inner { }
    }
    class C extends P {
         const Inner = 'x';
    }
(and vice versa) Best regards Tim Düsterhus

« previous php.internals (#126607) next »