From 67042276440a077e0176a8de01a6243eae4010c6 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Mon, 13 Aug 2012 22:28:14 +0200 Subject: [PATCH] [ext] made ext consistent with 8ec73cf4759f90b961de1732da1732e60c1dbfff --- ext/twig/twig.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) 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"; } -- 1.7.2.5