i am using my command line to excute a method within a class. however i keep getting the following message:
Error: Call to undefined function test() in Command line code on line 1
this is my class and method:
class DatasetTest
{
public function test()
{
echo ""worked";
}
}
this is my command line order:
$ php -r 'require "DatasetTest.php"; test();'
i also tried:
$ php -r 'require "DatasetTest.php"; $this->test();'
but got following message;
Error: Using $this when not in object context in Command line code on line 1