"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-07 20:36:26.297858
"""

```python
from typing import Callable, Any, Optional

class FallbackExecutor:
    """
    A class for executing functions with fallback mechanisms in case of errors.
    
    Attributes:
        primary_function (Callable): The main function to be executed.
        backup_function (Optional[Callable]): The function to execute if the primary fails.
        error_handling_callback (Optional[Callable]): A callback for custom error handling logic.
    
    Methods:
        run: Executes the primary function, and uses the fallback if an exception occurs.
    """
    
    def __init__(self,
                 primary_function: Callable[..., Any],
                 backup_function: Optional[Callable[..., Any]] = None,
                 error_handling_callback: Optional[Callable[[Exception], None]] = None):
        self.primary_function = primary_function
        self.backup_function = backup_function
        self.error_handling_callback = error_handling_callback
    
    def run(self, *args, **kwargs) -> Any:
        try:
            return self.primary_function(*args, **kwargs)
        except Exception as e:
            if self.backup_function is not None:
                result = self.backup_function(*args, **kwargs)
                if self.error_handling_callback:
                    self.error_handling_callback(e)
                return result
            else:
                raise

# Example usage
def main_function(x: int) -> str:
    """Divides x by 2 and returns the result as a string."""
    return f"Result is {x / 2}"

def backup_function(x: int) -> str:
    """Squares the input and returns the result as a string if primary fails."""
    return f"Squared value is {x * x}"

# Create an instance of FallbackExecutor
executor = FallbackExecutor(primary_function=main_function, backup_function=backup_function)

try:
    print(executor.run(4))  # Expected: Result is 2.0
except Exception as e:
    print(f"Error occurred during execution: {e}")

print(executor.run(0))  # This will use the backup function since division by zero error occurs
```

This code defines a `FallbackExecutor` class that takes a primary and optional backup functions, along with an error handling callback. The `run` method attempts to execute the primary function; if it fails due to an exception, it runs the backup function instead. An example usage is provided where division by zero triggers the fallback mechanism.