From 4e899caee4d95a6db5baeb7165c45aea50f8faab Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Thu, 7 Jul 2011 13:05:40 +0100 Subject: [PATCH] Add the properties as assoc keys, so that hash_find actually works on them. --- twig.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/twig.c b/twig.c index 7cf7ad7..02a95c7 100644 --- a/twig.c +++ b/twig.c @@ -437,7 +437,7 @@ static int twig_add_property_to_class(zend_property_info *pptr TSRMLS_DC, int nu zend_unmangle_property_name(pptr->name, pptr->name_length, &class_name, &prop_name); - add_next_index_string(retval, prop_name, 1); + add_assoc_string(retval, prop_name, prop_name, 1); return 0; } @@ -456,7 +456,7 @@ static int twig_add_dyn_property_to_class(zval **pptr TSRMLS_DC, int num_args, v ZVAL_STRINGL(&member, hash_key->arKey, hash_key->nKeyLength-1, 0); if (zend_get_property_info(ce, &member, 1 TSRMLS_CC) == &EG(std_property_info)) { zend_unmangle_property_name((&EG(std_property_info))->name, (&EG(std_property_info))->name_length, &class_name, &prop_name); - add_next_index_string(retval, prop_name, 1); + add_assoc_string(retval, prop_name, prop_name, 1); } return 0; } -- 1.7.2.5