if(true) return;
> class Foo {
> const halfpie = M_PI/2;
> }
>
> Oooh, excellent point.  Wave a finger and tell the user not to do that?

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.

Reply via email to