On Fri, Aug 16, 2013 at 1:00 AM, Sara Golemon <poll...@php.net> wrote:

> I wasn't going to bring this up, but an intersectional idea I had a few
> years ago....  Static Constructor.  Just like an instance constructor, but
> called on initial load.
>
> class Foo {
>   public static __static_construct(/* no args allowed */) {
>     /* Run on class load, similar to (main), but without better
> determinance */
>   }
> }
>
> * Reduces the footprint wherein a class's definition *can* change.
> * Solves the early exit problem
> * If exposed to userspace, could provide a nice encapsulation for things
> like stream_wrapper_register() calls.
>

Related - Python metaclasses <3

Arpad

Reply via email to