安装think-cache后报错,php8.4 函数参数类型声明不兼容
ErrorException: Webman\ThinkCache\CacheManager::getConfig(): Implicitly marking parameter $name as nullable is deprecated, the explicit nullable type must be used instead in /app/vendor/webman/think-cache/src/CacheManager.php:50
PHP/8.4.4 (Jit off)
webmanV2.1.2
我记得从PHP8.4开始,如果指定变量类型(严格模式)的话,函数的string形参默认值不能为null。你可以将其默认值改为''(空字符串)。但是这样下面如果使用了(??)这个简化的null检查三元运算符应该改为(?:)这个简化的空检查三元运算符。
可以看一下PHP官方文档中有这个相关说明。