
# 如何解决 Declaration of xxxx must be compatible with xxxx？
如果遇到这种报错，基本上都是版本不兼容导致的，因为社区开源软件依赖会不定期更新。比如遇到以下报错：
```
Declaration of Obs\Internal\Common\CheckoutStream::read($length) must be compatible with Psr\Http\Message\StreamInterface::read(int $length)
```
从报错得知，CheckoutStream::read($length) 缺少int类型声明，很大可能就是psr/http-message版本太高（可以从composer.lock找到准确的版本号），另外查看Github社区发现psr/http-message 1.1版本升级到2.0 增加了类型声明，最后降低psr/http-message 版本为1.1解决问题。
