From 49b885c17034a3fc0d81f047e0ebd8c99ccbfbfb Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Wed, 13 Jul 2011 18:20:47 +0100 Subject: [PATCH] After instantiating the object, call the constructor and make sure we return from the function. --- twig.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/twig.c b/twig.c index a7e2887..b43f16b 100644 --- a/twig.c +++ b/twig.c @@ -461,6 +461,8 @@ void TWIG_NEW(zval *object, char *class, zval *value) object_init_ex(object, *pce); Z_SET_REFCOUNT_P(object, 1); Z_UNSET_ISREF_P(object); + + TWIG_CALL_Z(object, "__construct", value); } static void twig_add_array_key_to_string(zval **zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) @@ -869,6 +871,7 @@ PHP_FUNCTION(twig_template_get_attributes) */ if (TWIG_INSTANCE_OF_USERLAND(object, "Twig_TemplateInterface")) { TWIG_NEW(return_value, "Twig_Markup", ret); + return; } /* return $ret; -- 1.7.2.5