From 8fa97bb526b5b639449267af9906126a615034f9 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Thu, 23 Aug 2012 13:32:55 +0200 Subject: [PATCH] php5.2 fix --- ext/twig/twig.c | 3 ++- test/Twig/Tests/TemplateTest.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/twig/twig.c b/ext/twig/twig.c index 3c340f2..bcde29b 100644 --- a/ext/twig/twig.c +++ b/ext/twig/twig.c @@ -675,7 +675,8 @@ PHP_FUNCTION(twig_template_get_attributes) Z_TYPE(zitem) = IS_LONG; break; case IS_DOUBLE: - ZVAL_LONG(&zitem, zend_dval_to_lval(Z_DVAL(zitem))); + Z_TYPE(zitem) = IS_DOUBLE; + convert_to_long(&zitem); break; } diff --git a/test/Twig/Tests/TemplateTest.php b/test/Twig/Tests/TemplateTest.php index 978a5be..9c5b909 100644 --- a/test/Twig/Tests/TemplateTest.php +++ b/test/Twig/Tests/TemplateTest.php @@ -320,7 +320,7 @@ class Twig_TemplatePropertyObjectAndIterator extends Twig_TemplatePropertyObject } } -class Twig_TemplatePropertyObjectAndArrayAccess extends Twig_TemplatePropertyObject implements \ArrayAccess +class Twig_TemplatePropertyObjectAndArrayAccess extends Twig_TemplatePropertyObject implements ArrayAccess { private $data = array(); -- 1.7.2.5