"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-06 16:37:21.605391
"""

```python
from typing import Callable


class FallbackExecutor:
    """
    A class for creating a fallback execution mechanism that handles errors by falling back to a simpler or default function.
    """

    def __init__(self, primary_function: Callable, fallback_functions: list[Callable]):
        """
        Initialize the FallbackExecutor with a primary function and a list of fallback functions.

        :param primary_function: The main function to execute. It should accept the same arguments as the fallbacks.
        :param fallback_functions: A list of fallback functions. These will be tried in order if an error occurs.
        """
        self.primary_function = primary_function
        self.fallback_functions = fallback_functions

    def execute(self, *args, **kwargs) -> any:
        """
        Execute the primary function or one of its fallbacks based on success.

        :param args: Arguments to pass to the functions.
        :param kwargs: Keyword arguments to pass to the functions.
        :return: The result of the successfully executed function.
        """
        try:
            return self.primary_function(*args, **kwargs)
        except Exception as e:
            print(f"Primary function failed with error: {e}")
        
        for fallback in self.fallback_functions:
            try:
                return fallback(*args, **kwargs)
            except Exception as e:
                print(f"Fallback function failed: {fallback} - Error: {e}")

        raise RuntimeError("All functions have failed.")


# Example usage
def main_function(x):
    """
    A primary function that might fail due to division by zero.
    
    :param x: An integer value.
    :return: The reciprocal of x if x is not zero, otherwise raises an error.
    """
    if x == 0:
        raise ZeroDivisionError("Division by zero!")
    return 1 / x


def fallback_function1(x):
    """
    A simple fallback function that returns a default value.

    :param x: An integer value.
    :return: The reciprocal of x if x is not zero, otherwise returns -1.
    """
    print("Using fallback function 1")
    return -1


def fallback_function2(x):
    """
    Another fallback function that might fail for other reasons.
    
    :param x: An integer value.
    :return: The reciprocal of x with a warning if x is not zero, otherwise returns None.
    """
    print("Using fallback function 2")
    if x == 0:
        return None
    return 1 / x


# Create an instance of FallbackExecutor
executor = FallbackExecutor(main_function, [fallback_function1, fallback_function2])

# Execute the primary and fallback functions with different inputs
print(executor.execute(5))   # Should work normally
print(executor.execute(0))   # Should trigger fallbacks
```

This code defines a `FallbackExecutor` class that handles errors by falling back to simpler or default functions. It includes example usage for demonstration purposes.