mirror of
https://github.com/php-win-ext/php-lua.git
synced 2026-03-24 00:52:12 +01:00
46 lines
641 B
PHP
46 lines
641 B
PHP
--TEST--
|
|
Bug #73964 (Segmentation fault (11))
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded("lua")) print "skip lua extension missing";
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
|
|
class LuaTest
|
|
{
|
|
function __construct()
|
|
{
|
|
$this->lua = new Lua();
|
|
$this->lua->registerCallback("log", array($this, "API_LuaLog"));
|
|
}
|
|
|
|
|
|
function API_LuaLog( $entry)
|
|
{
|
|
echo("from lua: $entry");
|
|
}
|
|
|
|
public function RunTest()
|
|
{
|
|
$this->lua->eval(<<<CODE
|
|
function TestFunc(str)
|
|
log(str)
|
|
|
|
end
|
|
|
|
CODE
|
|
);
|
|
$GamePackage = $this->lua->RootTable;
|
|
|
|
$this->lua->call("TestFunc", array("okey"));
|
|
}
|
|
}
|
|
|
|
|
|
$a = new LuaTest();
|
|
$a->runtest();
|
|
?>
|
|
--EXPECT--
|
|
from lua: okey
|