On 19 June 2025 12:01:04 BST, ignace nyamagana butera <nyamsp...@gmail.com>
wrote:
>RFC proposal link: https://wiki.php.net/rfc/data_encoding_api
Thanks for working on this, I have often had to implement base64url and been
frustrated it's not just a built-in option.
I like the look of the new API. Using namespaced enums is currently quite
verbose, but that's something we could try to fix at at the language level -
e.g. Swift has some nice inference rules, so you can write the equivalent of
base64_encode($string, ::UrlSafe).
One thing I think the RFC should mention is the future of the existing
base64_encode/decode functions. Am I right in thinking that with one parameter,
the new namespaced versions will be identical to the old? If so, we have the
option to make the existing functions aliases for the new. Or, we can leave
them as-is, but plan to deprecate them. What we probably don't want is to
indefinitely have two versions with such similar names but different signatures.
Rowan Tommins
[IMSoP]