Currently my code looks like that:
switch ($_POST[\'operation\']) { case \'create\': $db_manager->create(); break; case \'retrieve\':
You can use method_exists(). But this is a really bad idea
method_exists()
If $_POST['operation'] is set to some magic function names (like __set()), your code will still explode. Better use an array of allowed function names.
$_POST['operation']