1.10.57 #10476
Replies: 1 comment 2 replies
-
This change:
Seems to have maybe gone a bit further than a fix - perhaps into more "bleeding edge" territory? The PHP manual states:
But the first line I think is a little misleading. Without the callable provided, this is the data/outcome: $array = [
'a', // ok
true, // ok
false, // removed
null, // removed
'1', // ok
1, // ok
123, // ok
0 // removed
];
print_r(array_filter($array)); If you provide a callback that just returns the value, the result is the same. $array = [
'a', // ok
true, // ok
false, // removed
null, // removed
'1', // ok
1, // ok
123, // ok
0 // removed
];
print_r(array_filter($array, function ($value) {
return $value;
})); So it appears that there is a $list= array_filter($list, 'strlen');
// or
$list= array_filter($list, 'trim');
// etc which presumably will all need changing to having an actual anonymous function as the second argument, rather than a string function name. It's not a huge thing I guess, but we try and auto-patch much of our CI software - so things like this can just start appearing and then need a whole bunch of changes that were ultimately fine. |
Beta Was this translation helpful? Give feedback.
-
Bleeding edge 🔪
mixed
type based on config (#2885), thanks @schlndh!If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's
phpstan.neon
:Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more
Improvements 🔧
ClassReflection::getConstant()
return type (phpstan/phpstan-src@8d4ea60)ClassConstantReflection
with BC promise (phpstan/phpstan-src@8f82b79)Bugfixes 🐛
array_filter
callback return type (phpstan/phpstan-src@59ae706)@template
type in method call (phpstan/phpstan-src@11268e5), Bleeding edge generalizes generic type too aggressively since 1.10.48 #10473Function signature fixes 🤖
curl_multi_init()
cannot return false (#2882), thanks @staabm!error_log()
is impure (#2884), thanks @staabm!This discussion was created from the release 1.10.57.
Beta Was this translation helpful? Give feedback.
All reactions