https://github.com/reactphp/react/pull/225 should be ported over