On Wed, Sep 23, 2026, 15:52 Tim Düsterhus <[email protected]> wrote:
> > > Another possible solution, that I didn't yet evaluate, might be > > defining a magic constant `__MAIN__` that is equivalent to `__FILE__` > > of the script that is executed first. > > … defining a __MAIN__ constant, which should hopefully have much fewer > design considerations and might also benefit PHP applications that don't > leverage the front-controller approach to protect internal files from > direct access (e.g. as a native variant of phpBB’s IN_PHPBB constant). > I think already this would work with `realpath($_SERVER['SCRIPT_FILENAME'])` -- Alex
