Sample text:
$text = \'Administration\\Controller\\UserController::Save\';
Task - extract everything before ::
Option 1:
efficient ? if you mean by execution time. then run each in a loop multiple (1000) time and check the execution time.