if (Z_TYPE_P(next) != IS_ARRAY)   maybe better