from typing import Any


def phrase_unsafe_eval(phrase: str, env: dict) -> Any:
    """
    Unsafely evaluates the given phrase of a command.
    If performs the evaluation in the following order.

    1. Looks up the value from ``env['_extras_']`` dict using phrase as key
    2. Looks up the value from ``env`` dict using phrase as key
    3. Invokes the built-in function :func:`eval`.
    """
    if not phrase:
        return None
    extras = env.get('_extras_', {})
    if phrase in extras:
        return extras[phrase]
    if phrase in env:
        return env[phrase]
    return eval(phrase, env)