Closed Xon closed 5 months ago
@Xon the 3.74.x branch is for PHP 7.x only
Use 4.8.x for PHP 8, I think this patch can be submitted there
@serbanghita This should not have been closed. The problem still exists in PHP 8.4, on the 4.8.x branch. But fewer changes are required:
MobileDetect.php
public function __construct(
- Cache $cache = null,
+ ?Cache $cache = null,
array $config = [],
) {
CacheException.php
- public function __construct($message, $code = 0, \Throwable $previous = null)
+ public function __construct($message, $code = 0, ?\Throwable $previous = null)
Describe the bug https://wiki.php.net/rfc/deprecate-implicitly-nullable-types
Using php 8.4-dev, implicit nulls in function arguments will generate deprecation notices.
An example of an implicit null:
The fix: