/* I like the idea of OneShot classes.
Thanks to that Anonymous bro\sist for precising
new class( $a, $b )
ˉˉˉˉˉˉˉˉˉ
If you are looking for "Delayed OneShot Anonymous Classes" for any reason (like the reason: loading files in a readable manner while not using autoload), it would probably look something like this; */
$u = function()use(&$u){
$u = new class{private $name = 'Utils';};
};
$w = function(&$rewrite)use(&$w){
$w = null;
$rewrite = new class{private $name = 'DataUtils';};
};
// Usage;
var_dump(
array(
'Delayed',
'( Self Destructive )',
'Anonymous Class Creation',
array(
'Before ( $u )' => $u,
'Running ( $u() )' => $u(),
'After ( $u )' => $u,
),
0,0,
0,0,
0,0,
'Delayed',
'( Overwriting && Self Destructive )',
'Anonymous Class Creation',
array(
'Before ( $w )' => $w,
'Running ( $w($u) )' => $w($u),
'After ( $w )' => $w,
'After ( $u )' => $u
)
)
);
// btw : oh shoot I failed a spam challenge