<?php

class TestClass {
	public function test() {
		echo __METHOD__;
	}
}

$test = 'test';
$obj = new TestClass;
$obj->$test();