3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface CacheInterface { public function get(string $key): ?string; public function set(string $key, array $value); } class ApcCache implements CacheInterface { private $client; public function __construct($client) { $this->client = $client; } public function get(string $key):?string { $ret = apc_fetch($key); if (empty($ret)) { return null; } return $ret; } }
Output for 7.1.0 - 7.1.21, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
Fatal error: Class ApcCache contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (CacheInterface::set) in /in/VqNle on line 9
Process exited with code 255.
Output for 7.0.0 - 7.0.31
Parse error: syntax error, unexpected '?' in /in/VqNle on line 5
Process exited with code 255.

preferences:
175.83 ms | 401 KiB | 205 Q