@thepanz@acelaya@Skoop There is no reason not to install PHPStan with Composer. It has zero dependencies and won’t conflict with your project.
And it’s the only way for extensions to work. If you install a PHPStan extension, it depends on phpstan/phpstan so it will install PHPStan with Composer anyway.
These are slides about PHPStan's benevolent union type, which I talked about at a meetup with @Girgias in Tokyo yesterday. The article is in Japanese, but the slide PDF is in English. https://tadsan.fanbox.cc/posts/7650964
@dantleech If I have an anchor # in my link, is it going to download the URL and check if there’s an HTML element with that ID in that document? That would definitely sell it to me!
PHPerKaigi, one of the largest PHP conferences in Japan, has been held since yesterday. This is my third presentation at the PHP conference this year, and as always, I'm working as a member of the staff.
“Ever since #PHP 7 came out, and with the improvements in the language since then—particularly around performance—PHP outshines basically every other application stack on the web. So, if you’re worried about performance and you’re worried about developer productivity, you should be choosing PHP.”
— Matthew Weier O’Phinney ( @mwop ), “The 2024 State of PHP Development,” Zend by Perforce ( @zend )
@danrot@ramsey@mwop@zend You’re mostly gonna be waiting for the database to return results anyway, and on top of that add waiting for all the compiling as a developer.
I'm catching some flak for requiring array_filter callback to return a strict bool in the latest PHPStan release.
Returning non-bool like int or string is most likely a bug on user's side. Zero means the value gets filtered out, same for falsey strings like '' and '0'.
Are you plagued by reported undefined properties when you "declare" them on an interface using @property?
On PHP 8.2+ it doesn't fly because dynamic properties are restricted to classes with #[AllowDynamicProperties] attribute or __get() method.
We've come up with new PHPDoc tag @phpstan-require-extends that can be used above interfaces and traits to require the implementing/using class to extend a certain parent.
If it allows dynamic properties it'll make them exist on the interface too!
but it depends on the new keyword which invokes the autoloader, which invalidates this apporach for PHPBench .. 😐 that's really frustrating as any other way of composing sampling pipelines with attributes is janky as f.
@ocramius@dantleech@ciaran You can interpret “new” in AST however you want in your own code, look at the class constructor statically. You don’t need to autoload it.
@ocramius@dantleech@ciaran I spent a lot of time last year refactoring so that PHPStan doesn’t need to go from Expr to runtime value, but instead to go Expr -> its own Type object, precisely to avoid autoloading.