fix for #59970 by marcelog at gmail dot com

contrary to stated here: https://bugs.php.net/bug.php?id=59970
this patch has not been included so far.
i spend half a day to look for a solution till i stumbled over that old bug report, and was close to getting insane when it claimed the patch was in there while source and behaviour of the latest extension from pecl said otherwise.