Unified PHP Callback implementation.