具体变量是存在 Nginx 核心的一个 hash table 里的,ngx.var.VARIABLE 是通过触发其元表的 __index 域方法触发变量查找的,所以你通过序列化 table 是无法得到这些变量信息的。
On Sunday, August 13, 2017 at 5:53:11 PM UTC+8, micr...@gmail.com wrote:
ngx.say(type(ngx.var))
上面得到了一个table
local sss = serialize(ngx.var)
ngx.say(sss)
serialize 是我网上找的一个方法,看起来转失败了,并没有输出大堆字符串
有没有类似与 php 的var_dump的方法