mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-22 23:07:20 +00:00
d201312a0e
PHP 8 added support for named parameters however will throw an error when a named parameter, which does not exist, will be called/appears. In this case the code uses `array_filter(compact('subject))` to conveniently prepend `$subject` to the callback, if it's non-null. It's then combined with `$params` but mixing a hash wih a sequential array and then end result is `['subject' => …, ]` which then triggers this TypeError in PHP 8. The solution applies `array_values()` on above array as to remove the keys and then the error disappears. With this change, our internal test suite (2k tests) is green on both PHP8 and PHP7.4, aka this change is expecte to be backwards compatible. |
||
---|---|---|
.. | ||
CakeNumber.php | ||
CakeText.php | ||
CakeTime.php | ||
ClassRegistry.php | ||
Debugger.php | ||
File.php | ||
Folder.php | ||
Hash.php | ||
Inflector.php | ||
ObjectCollection.php | ||
Sanitize.php | ||
Security.php | ||
Set.php | ||
String.php | ||
Validation.php | ||
Xml.php |