Skip to content

Conversation

imhayatunnabi
Copy link

Issue

HandleExceptions bootstrap has PHP compatibility issues:

  • get_exception_handler() and get_error_handler() only available in PHP 8.5+
  • Static method using $this causing errors
  • Version-specific enable() call with wrong arguments

Solution

  • Replace get_*_handler() with set_*_handler(null) for PHP <8.5 compatibility
  • Fix static context by using method_exists() check instead of $this
  • Simplify enable() call to remove argument mismatch

Testing

  • Maintains same functionality across PHP versions
  • No breaking changes to existing behavior
  • Backward compatible with PHP 7.4+

Changes

  • flushHandlersState(): Use compatible handler detection
  • ErrorHandler check: Use method existence validation
  • Remove version-specific logic causing argument errors

@imhayatunnabi imhayatunnabi marked this pull request as draft October 13, 2025 12:06
@imhayatunnabi imhayatunnabi deleted the fix/12.x-php-compatibility-handle-exceptions branch October 13, 2025 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant