From: Arnaud Le Blanc Date: Mon, 13 Aug 2012 20:28:14 +0000 (+0200) Subject: [ext] made ext consistent with 8ec73cf4759f90b961de1732da1732e60c1dbfff X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=67042276440a077e0176a8de01a6243eae4010c6;p=konrad%2Ftwig.git [ext] made ext consistent with 8ec73cf4759f90b961de1732da1732e60c1dbfff --- diff --git a/ext/twig/twig.c b/ext/twig/twig.c index a32f3a3..3c340f2 100644 --- a/ext/twig/twig.c +++ b/ext/twig/twig.c @@ -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"; }