in reply to What is an INIT block?
CHECK blocks are run after all the code has been parsed, but before main execution starts, so you can be sure that all the parsing is done.
INIT blocks are run after parsing and CHECK blocks, but before mainline execution.
The big difference between INIT and CHECK blocks comes in with bytecode compilation. If you're compiling to bytecode (lucky you) then CHECK blocks are run before the bytecode is dumped, and INIT blocks aren't run at all. When you load in bytecode to run, then any pending INIT blocks are run before the code starts in.
update:Damn, swapped init and check. Fixed
|
|---|