-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
phpstan/phpstan-src
#1734Description
Bug report
When calling pathinfo on an empty string, the function returns an array with only 2 keys:
- basename
- filename
Example:
php -r 'var_dump(pathinfo(""));'
Command line code:1:
array(2) {
'basename' =>
string(0) ""
'filename' =>
string(0) ""
}
On the other hand, phpstan expects this array to always contain the "dirname" offset.
So phpstan throws an error if we check whether dirname exists or not:
Code snippet that reproduces the problem
https://phpstan.org/r/fa3b7db7-5ce8-41d0-a63f-73742025ea3d
Expected output
PHPStan shouldn't detect an issue when we test whether the dirname offset exists.
Metadata
Metadata
Assignees
Labels
No labels