public static function get($path) {
$result = self::$cfg;
foreach (explode('/', $path) as $key) {
if (!array_key_exists($key, $result)) {
throw new InvalidArgumentException("Path $path is invalid");
}
$result = $result[$key];
}
return $result;
}
BTW, using a static class is not usually a good idea, you should instantiate it. See How Not To Kill Your Testability Using Statics.