Interoperability¶
Interoperability is the ability of distinct software components or systems to exchange information and work together effectively, without special adaptation effort.
In the PHP ecosystem, interoperability is promoted by PHP-FIG, the PHP Framework Interop Group, through PSR standards, which define common interfaces for loggers, the PSR-3, HTTP messages, the PSR-7, dependency injection containers, the PSR-11, caches, the PSR-6 and PSR-16, event dispatchers, the PSR-14, and HTTP handlers, the PSR-15.
Designing against interfaces rather than concrete implementations enables components from different libraries and frameworks to be composed freely. This is the foundation of the modern PHP package ecosystem.
<?php
use Psr\Log\LoggerInterface;
// Any PSR-3 compliant logger may be injected
function process(LoggerInterface $logger): void {
$logger->info('Processing started');
}
?>
See also PHP-FIG site and PHP-FIG: PSR standards.
Related : PHP Standards Recommendations (PSR), Interface, Framework Interoperability Group (FIG), Dependency Injection, Composition, Decoupling, Compatibility, Clock, Foreign Function Interface (FFI)