Workaround on Functional Programming implementation of PHP