From: Derick Rethans Date: Wed, 13 Jul 2011 17:20:47 +0000 (+0100) Subject: After instantiating the object, call the constructor and make sure we return from... X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=49b885c17034a3fc0d81f047e0ebd8c99ccbfbfb;p=web%2Fkonrad%2Ftwig.git After instantiating the object, call the constructor and make sure we return from the function. --- 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;