avoid usage of 'type' before the null pointer check
data type fixes
fix implicit st_rdev element handling when negative value was passed
fix stat vs zend_stat