diff --git a/Smarty.addons.php b/Smarty.addons.php
index 82b0a8a4..ec194ff4 100644
--- a/Smarty.addons.php
+++ b/Smarty.addons.php
@@ -155,24 +155,33 @@ function smarty_func_html_options()
extract(func_get_arg(0));
- settype($output, 'array');
- settype($values, 'array');
- settype($selected, 'array');
-
$html_result = "";
- for ($i = 0; $i < count($output); $i++) {
- /* By default, check value against $selected */
- $sel_check = $values[$i];
- $html_result .= "