Move PHP-version-agnostic part to framework
See thekid/core@c51ea08