It then reads maxlen bytes from src and stores them in the allocated buffer.
php_stream_copy_to_mem() allocates a buffer maxlen +1 bytes in length using pemalloc() (passing persistent). It then reads maxlen bytes from src and stores them in the allocated buffer.