Skip to content

String parsing: numeric cast comparison and quote delimiter check #31

@rafageist

Description

@rafageist

From PHPStan baseline: src/div.php lines 8444 and 8447.

Snippet:
`
if (is_numeric()) {
return ((float) === (int) ) ? (int) : (float) ;
}

if (preg_match('/^("|').*(\1)$/s', , ) && [1] === [2]) {
...
}
`

PHPStan reports strict float/int comparison always false and $m[1] === [2] always false (no capture group 2). Review numeric parsing and quote matching logic.

Metadata

Metadata

Assignees

Labels

phpstanStatic analysis (PHPStan) findings

Type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions