Git Product home page Git Product logo

Comments (12)

ondrejmirtes avatar ondrejmirtes commented on May 25, 2024

from phpstan-strict-rules.

Axent96 avatar Axent96 commented on May 25, 2024

in phpstan.org: https://phpstan.org/r/5d6e8557-1ca9-4293-af0d-c56f617b77a9
I get only one error: "Result of && is always true."

from phpstan-strict-rules.

ondrejmirtes avatar ondrejmirtes commented on May 25, 2024

I challenge you to produce "not ok": https://3v4l.org/U8SJ7

from phpstan-strict-rules.

Axent96 avatar Axent96 commented on May 25, 2024

here - https://3v4l.org/ecfEs

from phpstan-strict-rules.

ondrejmirtes avatar ondrejmirtes commented on May 25, 2024

PHPStan also tells you that: https://phpstan.org/r/92b6e91f-7212-4eb2-8ed2-ec5ec8a3c8c3 So I don't see a bug here.

from phpstan-strict-rules.

Axent96 avatar Axent96 commented on May 25, 2024

for exp.: we get the separator from any function and the separator have empty string. We must verify "\is_array($texts) && \is_array($texts2)"

`
$separator = '';
$array = 'this is, a test';
$array2 = 'this is, a test2';
$texts = explode($separator, $array);
$texts2 = explode($separator, $array2);

if (\is_array($texts) && \is_array($texts2)){
echo 'ok';
} else {
echo 'not ok';
}`

`
public function test(string $separator)
$array = 'this is, a test';
$array2 = 'this is, a test2';
$texts = explode($separator, $array);
$texts2 = explode($separator, $array2);

if (\is_array($texts) && \is_array($texts2)){
echo 'ok';
} else {
echo 'not ok';
}

}
`

from phpstan-strict-rules.

ondrejmirtes avatar ondrejmirtes commented on May 25, 2024

I can't reproduce it: https://phpstan.org/r/3aa1b88b-1278-461b-b66b-48267f5b1dc4

from phpstan-strict-rules.

Axent96 avatar Axent96 commented on May 25, 2024

https://phpstan.org/r/39771324-41ee-4ef1-aa9f-65c900b5f55c

from phpstan-strict-rules.

ondrejmirtes avatar ondrejmirtes commented on May 25, 2024

https://3v4l.org/ecfEs

We're not making any progress here. Unless you produce an example that shows "not ok" on 3v4l.org and "No errors" on phpstan.org, there's no bug.

from phpstan-strict-rules.

Axent96 avatar Axent96 commented on May 25, 2024

https://3v4l.org/ecfEs - "not ok"

https://phpstan.org/r/39771324-41ee-4ef1-aa9f-65c900b5f55c

+------------------------------------------------------------------------------+
| Line | test.php |
+------------------------------------------------------------------------------+
| 9 | Result of && is always false. |
| 9 | Call to function is_array() with false will always evaluate to false. |
| 9 | Call to function is_array() with false will always evaluate to false. |
+------------------------------------------------------------------------------+

from phpstan-strict-rules.

ondrejmirtes avatar ondrejmirtes commented on May 25, 2024

Yes, PHPStan tells you actually what's going on. It can differentiate between empty (false), non-empty (array<string>) and unknown (array<string>|false) delimiter.

from phpstan-strict-rules.

github-actions avatar github-actions commented on May 25, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from phpstan-strict-rules.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.