PHPStan Profile
PHPStan

@phpstan

7,426
Followers
1
Following
5
Media
1,078
Statuses

Find bugs in your code without writing tests! Created by @OndrejMirtes

Joined July 2016
Don't wanna be here? Send us removal request.
@phpstan
PHPStan
4 years
Introducing PHPStan Pro – Save Your Keystrokes and Get More Productive! 🚀
3
55
129
@phpstan
PHPStan
6 years
PHPStan has finally a logo! 🎉
Tweet media one
10
24
93
@phpstan
PHPStan
3 years
PHPStan started contributing to PHP Foundation to ensure the PHP language continues to have a bright future!
Tweet media one
0
2
89
@phpstan
PHPStan
6 years
It almost feels like PHPStan is gaining consciousness! The new version in the works is getting really smart about what it can figure out!
Tweet media one
0
26
75
@phpstan
PHPStan
5 years
If you’re using PHPStan, you’re already covered against cases like this:
Tweet media one
2
12
40
@phpstan
PHPStan
5 years
💡Tip of the Day: PHPStan already finds a lot of bugs for you, but you can enhance its bug-finding abilities by writing a custom extension. By writing a simple dynamic return type extension for gettext functions, we were able to find bugs in many sprintf() calls👇
Tweet media one
Tweet media two
1
12
30
@phpstan
PHPStan
6 years
empty() leads to unpredictable results in a lot of cases. That’s why strict-rules in 0.10 will tell you not to use it!
@nikolaposa
Nikola Poša
6 years
Good to know:
2
12
21
3
5
24
@phpstan
PHPStan
6 years
You don’t have to find out about these sneaky bugs using debugger or in production because PHPStan has your back!
@SammyK
SammyK,
6 years
35% of you would have run into the same bug I did. floor() returns whole numbers as floats (0.0) and since we're using strict comparisons (===), 0 ≠ 0.0. So in our example we get bool(false). FTR Step debugging helped me find this bug in my script 🦶🐛🤗
2
3
11
0
6
22
@phpstan
PHPStan
5 years
PHPStan 0.11.14 has been released with this feature behind the bleedingEdge toggle. You can try it out now, it will be enabled for everyone in 0.12.
@phpstan
PHPStan
5 years
new static() can only be safely used in a class with a final constructor or in a final class, at which point you can simply use new self(). I plan to add this rule in the next version of PHPStan. What do you think? Do you have any counter-examples? 📊
5
3
7
0
13
16
@phpstan
PHPStan
4 years
@Ocramius PHPStan would still mark it as an error on level 0 (unused constructor parameter).
1
1
13
@phpstan
PHPStan
1 year
New release: PHPStan 1.10.10 #phpstan
0
2
12
@phpstan
PHPStan
5 years
@hpatoio Hi, I know about these interesting rulesets: roave/no-floaters thecodingmachine/phpstan-strict-rules thecodingmachine/phpstan-safe-rule pepakriz/phpstan-exception-rules Just search for “phpstan” 😊
2
4
12
@phpstan
PHPStan
2 years
New release: PHPStan 1.4.4 #phpstan
0
2
11
@phpstan
PHPStan
6 years
Turns out you don’t!
@berenddeboer
Berend de Boer
6 years
Back to PHP, so annoying you need to run tests in order to detect stuff a compiler would have caught
2
0
0
0
0
10
@phpstan
PHPStan
2 years
New release: PHPStan 1.8.7 #phpstan
0
6
10
@phpstan
PHPStan
4 years
Unsure why PHPStan reports "Unsafe usage of new static()" and how to solve it? There's a new blogpost with an explanation and possible solutions:
0
5
9
@phpstan
PHPStan
6 years
Interesting problem - array with string keys can never be fully typesafe. See vs.
2
5
8
@phpstan
PHPStan
1 year
New release: PHPStan 1.10.5 #phpstan
0
0
7
@phpstan
PHPStan
5 years
new static() can only be safely used in a class with a final constructor or in a final class, at which point you can simply use new self(). I plan to add this rule in the next version of PHPStan. What do you think? Do you have any counter-examples? 📊
Awesome, looking forward!
98
No, bad idea :(
28
5
3
7
@phpstan
PHPStan
6 years
Static analyser developer diary: SimpleXMLElement has custom-defined behaviour for casting object to float and int, something that isn’t possible in userland code 😊
3
4
7