From 7563e847bdcaf4fe1d13deab96cea9969d51a061 Mon Sep 17 00:00:00 2001 From: Empty Hua Date: Mon, 24 Jun 2013 21:09:28 +0800 Subject: [PATCH 1/2] bugfix:#65097,don't ignore array[0] --- lua.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lua.c b/lua.c index debbee7..d6dee2c 100644 --- a/lua.c +++ b/lua.c @@ -453,11 +453,6 @@ int php_lua_send_zval_to_lua(lua_State *L, zval *val TSRMLS_DC) { ZVAL_STRINGL(zkey, key, len - 1, 1); break; case HASH_KEY_IS_LONG: - if (idx == 0) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE - , "attempt to pass an array index begin with 0 to lua, the index 0 will be discarded"); - continue; - } MAKE_STD_ZVAL(zkey); ZVAL_LONG(zkey, idx); break; @@ -469,6 +464,7 @@ int php_lua_send_zval_to_lua(lua_State *L, zval *val TSRMLS_DC) { zval_ptr_dtor(&zkey); } + --ht->nApplyCount; } break; default: From 48f839a62d8e9b4bc656543d21216bcdf0444d85 Mon Sep 17 00:00:00 2001 From: Emptyhua Date: Mon, 24 Jun 2013 21:12:53 +0800 Subject: [PATCH 2/2] Update README --- README | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README b/README index 2825319..7c3442c 100644 --- a/README +++ b/README @@ -1,2 +1,6 @@ "Lua is a powerful, fast, light-weight, embeddable scripting language." This extension embeds the lua interpreter and offers an OO-API to lua variables and functions. + +==2013-06-24 +* bugfix:https://bugs.php.net/bug.php?id=65097 +* don't ignore 0 index when converting php var to lua