PHP memory issues with exceptions supporting __set
There is a custom exception class (which I have reduced to its minimum for this posting):
PHP memory issues
There is a PHP framework taking care about generating links within an application. Each (potential) page is an object and can tell whether it may be called depending on e.g. user, context, data or arbitrary other things. This ensures that only valid links are shown while anything else can be either suppressed, replaced by text or throw an error.