3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface ConfigurationProvider { public function getConfig() : array; } final class ConfigurationProviderImplementing implements ConfigurationProvider { public function getConfig() { return []; } } $provider = new ConfigurationProviderNonImplementing(); var_dump(! $provider instanceof ConfigProviderInterface && ! is_callable([$provider, 'getConfig']));
based on IUSPG
Output for 7.0.0 - 7.2.8
Fatal error: Declaration of ConfigurationProviderImplementing::getConfig() must be compatible with ConfigurationProvider::getConfig(): array in /in/4ic0H on line 8
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Class undefined: ConfigurationProviderNonImplementing in /in/4ic0H:17 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/4ic0H on line 5
Process exited with code 255.