{% if is_optional %}
let {{ php_name }}_core: Option<Vec<_>> = {{ php_name }}.map(|strs| strs.into_iter().map(|s| serde_json::from_str::<_>(&s).map_err(|e| ext_php_rs::exception::PhpException::default(e.to_string()))).collect::<Result<Vec<_>, _>>()).transpose()?;
{% else %}
let {{ php_name }}_core: Vec<_> = {{ php_name }}.into_iter().map(|s| serde_json::from_str::<_>(&s).map_err(|e| ext_php_rs::exception::PhpException::default(e.to_string()))).collect::<Result<Vec<_>, _>>()?;
{% endif %}
