fix bugsnet #66594, thanks ondrej@php.net