Comments (3)
Fixed phpstan/phpstan-src#3037
from phpstan.
Yeah, this is probably a bug.
It works correctly with list
type which you use should anyway: https://phpstan.org/r/221e19ac-7484-436b-8338-91e4a7f0b170
In non-list array, even when count($array)
is 1
, you don't have a guarantee that $array[0]
exists.
from phpstan.
Thanks for the fix!
from phpstan.
Related Issues (20)
- param-closure-this should report an invalid type being used
- Incompatible usages of callable param- tags should be reported as errors HOT 1
- Typehint for $this in included file requires fully qualified name HOT 1
- Duplicate code does not generate a helpfull message
- Can't check if Iterator is empty HOT 1
- [False positive] "yield from" doesn't seem to be considered executed HOT 3
- Detect all possible implementations of abstract class in match HOT 1
- Wrong Parameter #3 $x ... of method B::foo() should be contravariant with parameter $x ... of method A::foo()
- Order of docblocks and attributes might need to mentioned in the docs? HOT 1
- Error reported using static create method with generics HOT 2
- Call to an undefined static method ReflectionMethod::createFromMethodName() HOT 6
- Strict comparison using PPP between XXX and YYY will always evaluate to false. HOT 1
- Array is not considered equal to itself if it contains NANs HOT 1
- Variable X in isset() always exists and is not nullable for any array item HOT 1
- Multiple interfaces not supported HOT 1
- sprintf with only literal-string should return literal-string HOT 2
- array_change_key_case() is not reported to return different case keys
- Unary operation on string results in error HOT 2
- Generic trait: type of a method parameter in an abstract method is not specified HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpstan.