PHP: Replace constant Generation