Zenexer
Repos
80
Followers
35
Following
5

Events

issue comment
WSL2: Seek of directory entry by lseek does not work on v9fs

Could we add a bug label to this?

Created at 6 days ago
issue comment
array_filter should allow $callback to be null

Thanks! In the future, I don’t mind updating adding tests; that’s usually pretty easy.

Created at 1 month ago
issue comment
array_filter should allow $callback to be null

It looks like this would be simple to fix. Would a basic PR that modifies FunctionSignatureMap.php and adds tests be sufficient, or would that likely cause issues with analysis of the callback's types? If it's simple, I can submit a PR.

Created at 1 month ago
opened issue
array_filter should allow $callback to be null

Phan 5.4.0 php-ast version 1.0.16 PHP version used to run Phan: 8.1.9

<?php

print_r(array_filter([0, 1], null));

Result:

input:3: PhanTypeMismatchArgumentInternalProbablyReal Argument 2 ($callback) is null of type null but \array_filter() takes callable(mixed):bool|callable(mixed,mixed):bool

That code is valid, though, and is the same as omitting the second argument.

While it's often easier to just omit the parameter, there are legitimate use cases for passing a nullable callback.

Created at 1 month ago
issue comment
Phan considers A[]|B[] and array<string|int,A|B> to be equivalent

Oof, that's quite unfortunate. Alright, thanks for taking the time to respond.

Created at 1 month ago
closed issue
Phan considers A[]|B[] and array<string|int,A|B> to be equivalent

Phan 5.4.0 php-ast version 1.0.16 PHP version used to run Phan: 8.1.9

I noticed Phan spitting out errors like this:

src/Foo/Bar/AbstractHandler.php:161 PhanTypeMismatchProperty Assigning ($v as a field) of type non-empty-array<int,array> to property but \Foo\Bar\AbstractHandler->errors is \Stringable[]|\Foo\Phrase[]|string[]

That type didn't look right to me. Here's the actual code that declares AbstractHandler#errors:

abstract class AbstractHandler
{
	/**
	 * @var array<string|int, \Foo\Phrase|\Stringable|string>
	 */
	protected array $errors = [];
}

array<string|int, \Foo\Phrase|\Stringable|string> is different from \Stringable[]|\Foo\Phrase[]|string[]: the former allows mixed-type values, while the latter doesn't (they're all stringables, all phrases, or all strings--no mixing and matching).

I'm not sure whether this actually has any implications for Phan's accuracy, but I figured I'd mention it. I tried searching for related issues and found this, which indicates it may be intentional--though I'm not sure why.

Demo

Created at 1 month ago
opened issue
Phan considers A[]|B[] and array<int,A|B> to be equivalent

Phan 5.4.0 php-ast version 1.0.16 PHP version used to run Phan: 8.1.9

I noticed Phan spitting out errors like this:

src/Foo/Bar/AbstractHandler.php:161 PhanTypeMismatchProperty Assigning ($v as a field) of type non-empty-array<int,array> to property but \Foo\Bar\AbstractHandler->errors is \Stringable[]|\Foo\Phrase[]|string[]

That type didn't look right to me. Here's the actual code that declares AbstractHandler#errors:

abstract class AbstractHandler
{
	/**
	 * @var array<string|int, \Foo\Phrase|\Stringable|string>
	 */
	protected array $errors = [];
}

array<string|int, \Foo\Phrase|\Stringable|string> is different from \Stringable[]|\Foo\Phrase[]|string[]: the former allows mixed-type values, while the latter doesn't (they're all stringables, all phrases, or all strings--no mixing and matching).

I'm not sure whether this actually has any implications for Phan's accuracy, but I figured I'd mention it. I tried searching for related issues and found this, which indicates it may be intentional--though I'm not sure why.

Demo

Created at 1 month ago
issue comment
SIGSEGV in libpcre2 on PHP 8.1 (ARM)

Same issue. PHP 8.1.8 (cli) (built: Jul 11 2022 08:55:24) (NTS)

Created at 2 months ago
issue comment
SIGSEGV in libpcre2 on PHP 8.1 (ARM)

I have another stability issue I need to sort out first, but as soon as I'm sure everything is stable with JIT disabled, I'll give it another shot.

Created at 2 months ago

Preliminary support for big endian textures

Created at 2 months ago