I compared imap_base64 and base64_decode.
I tested to decode a 70 mb mail attachment read from disk into a variable with file_get_contents.
imap_base64 is slower, and use more memory than base64_decode. (win32)
imap_base64 took 2.2 sec and used 187 mb ram
base64_decode took 1.5 sec and used 131 mb ram