2 Calling PHP class methods from LUA
4 <?php if (!extension_loaded("lua")) print "skip"; ?>
11 public function test()
13 print ($this->x++).": ".str_repeat("test",10)."\n";
19 print str_repeat("two",10)."\n";
23 function one($x,$y,$z)
26 print str_repeat("one",10)."\n";
32 $lua->expose_function("php_one","one");
33 $lua->expose_function("php_two","two");
34 $lua->expose_function("php_three",array($test,"test"));
35 $lua->evaluatefile(dirname(__FILE__)."/012.lua");
36 var_dump($lua->peter);
39 0: testtesttesttesttesttesttesttesttesttest
43 oneoneoneoneoneoneoneoneoneone
48 oneoneoneoneoneoneoneoneoneone
50 1: testtesttesttesttesttesttesttesttesttest
51 twotwotwotwotwotwotwotwotwotwo
52 2: testtesttesttesttesttesttesttesttesttest