--TEST-- ipairs() and __ipairs --FILE-- 'ipairs_test1', 'With __ipairs' => 'ipairs_test2', 'No argument' => 'ipairs_test3', ); foreach ( $tests as $desc => $func ) { echo "$desc: "; $sandbox = new LuaSandbox; $sandbox->loadString( $lua )->call(); $sandbox->setCPULimit( 0.25 ); $sandbox->setMemoryLimit( 100000 ); try { print implode("\n", $sandbox->callFunction( $func ) ) . "\n"; } catch ( LuaSandboxError $e ) { echo "LuaSandboxError: " . $e->getMessage() . "\n"; } } --EXPECT-- Normal: Ok With __ipairs: Ok No argument: LuaSandboxError: [string ""]:32: bad argument #1 to 'ipairs' (table expected, got no value)