Just out of curiosity: is there anything about this that is PHP-specific? Seems like an approach that could easily be used more generically?