3 Commits

Author SHA1 Message Date
Xinchen Hui
1ff1eb10c9 releaseing 2.0.3 2017-02-10 19:13:44 +08:00
Xinchen Hui
cbe65b9ad6 Fixed issue #20 (PHP 7: Lua::eval(): unsupported type `unknown' for lua) 2016-05-30 11:44:12 +08:00
Xinchen Hui
04f7106631 back to dev 2016-05-26 17:42:59 +08:00
3 changed files with 33 additions and 8 deletions

12
lua.c
View File

@@ -351,7 +351,7 @@ zval *php_lua_get_zval_from_lua(lua_State *L, int index, zval *lua_obj, zval *rv
break;
}
switch(Z_TYPE(key)) {
switch (Z_TYPE(key)) {
case IS_DOUBLE:
case IS_LONG:
add_index_zval(rv, Z_DVAL(key), &val);
@@ -401,6 +401,7 @@ zval *php_lua_get_zval_from_lua(lua_State *L, int index, zval *lua_obj, zval *rv
int php_lua_send_zval_to_lua(lua_State *L, zval *val) /* {{{ */ {
try_again:
switch (Z_TYPE_P(val)) {
case IS_TRUE:
lua_pushboolean(L, 1);
@@ -408,6 +409,7 @@ int php_lua_send_zval_to_lua(lua_State *L, zval *val) /* {{{ */ {
case IS_FALSE:
lua_pushboolean(L, 0);
break;
case IS_UNDEF:
case IS_NULL:
lua_pushnil(L);
break;
@@ -472,6 +474,14 @@ int php_lua_send_zval_to_lua(lua_State *L, zval *val) /* {{{ */ {
}
}
break;
case IS_REFERENCE:
ZVAL_DEREF(val);
goto try_again;
break;
case IS_INDIRECT:
val = Z_INDIRECT_P(val);
goto try_again;
break;
default:
php_error_docref(NULL, E_ERROR, "unsupported type `%s' for lua", zend_zval_type_name(val));
lua_pushnil(L);

View File

@@ -23,11 +23,11 @@
<email>msaraujo@php.net</email>
<active>yes</active>
</developer>
<date>2016-05-26</date>
<time>10:50:27</time>
<date>2017-02-10</date>
<time>19:15:00</time>
<version>
<release>2.0.2</release>
<api>2.0.2</api>
<release>2.0.3</release>
<api>2.0.3</api>
</version>
<stability>
<release>stable</release>
@@ -35,7 +35,7 @@
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>
- Fixed issue #22 (Boolean FALSE is always TRUE)
- Fixed issue #20 (PHP 7: Lua::eval(): unsupported type `unknown' for lua)
</notes>
<contents>
<dir name="/">
@@ -81,6 +81,22 @@
<providesextension>lua</providesextension>
<extsrcrelease />
<changelog>
<release>
<date>2017-02-10</date>
<version>
<release>2.0.3</release>
<api>2.0.3</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
- Fixed issue #20 (PHP 7: Lua::eval(): unsupported type `unknown' for lua)
</notes>
</release>
<release>
<date>2016-05-26</date>
<version>
@@ -96,7 +112,6 @@
- Fixed issue #22 (Boolean FALSE is always TRUE)
</notes>
</release>
<release>
<date>2016-04-11</date>
<version>

View File

@@ -48,7 +48,7 @@ extern zend_module_entry lua_module_entry;
#define LUA_G(v) (lua_globals.v)
#endif
#define PHP_LUA_VERSION "2.0.2"
#define PHP_LUA_VERSION "2.0.3"
struct _php_lua_object {
lua_State *L;