3 ms·
You might be interested to know that in the alternate universe of Phabricator — the magnum opus of a PHP codebase that is the fourth cousin twice removed of Fac
by gorgoiler 5y ago
You might be interested to know that in the alternate universe of Phabricator — the magnum opus of a PHP codebase that is the fourth cousin twice removed of Facebook’s internal PHP stack — there was a function not unlike the one you describe:
https://github.com/phacility/libphutil/blob/034cf7cc39940b935e83923dbb1bacbcfe645a85/src/markup/render.php#L24 https://github.com/phacility/libphutil/blob/034cf7cc39940b93...
It’s verbose but I learned a lot from it. For example, returning a more specific type than String can eliminate a large class of security / escaping bugs.