printClassName(); // This prints method name and used namespace $test_magic_constants->printMethodName(); // This prints function name inside class and used namespace // same as method name, but without class $test_magic_constants->printFunction(); // This prints namespace name (works only with PHP 5.3) $test_magic_constants->printNamespace(); ?>