[ext] made ext consistent with 8ec73cf4759f90b961de1732da1732e60c1dbfff
authorArnaud Le Blanc <arnaud.lb@gmail.com>
Mon, 13 Aug 2012 20:28:14 +0000 (22:28 +0200)
committerArnaud Le Blanc <arnaud.lb@gmail.com>
Thu, 23 Aug 2012 09:54:31 +0000 (11:54 +0200)
ext/twig/twig.c

index a32f3a3..3c340f2 100644 (file)
@@ -670,6 +670,15 @@ PHP_FUNCTION(twig_template_get_attributes)
        INIT_PZVAL(&zitem);
        ZVAL_STRINGL(&zitem, item, item_len, 0);
 
+    switch (is_numeric_string(item, item_len, &Z_LVAL(zitem), &Z_DVAL(zitem), 0)) {
+    case IS_LONG:
+        Z_TYPE(zitem) = IS_LONG;
+        break;
+    case IS_DOUBLE:
+        ZVAL_LONG(&zitem, zend_dval_to_lval(Z_DVAL(zitem)));
+        break;
+    }
+
        if (!type) {
                type = "any";
        }