- strpos: documentation ( source)
- get_class_methods: documentation ( source)
<?php
class a
{
function run()
{
// Call each test to fill warnings array
foreach(get_class_methods($this) as $method)
{
if(strpos($method, 'test_') === 0)
$this->{$method}();
}
}
function test_a() { echo 'called'; }
}