Use zend_ polyfilled nan/finite, check finite