PHPantom version
phpantom_lsp 0.8.0-dirty
Installation method
Pre-built binary from GitHub Releases
Operating system
Windows x86_64
Editor
VS Code
Bug description
PHPantom reports a type mismatch for the valid two-argument strtr() form where the second argument is the replacement-pairs array.
Expected: no diagnostic.
Actual: Argument 2 ($from) expects string, got array{...} with code type_mismatch_argument.
Steps to reproduce
- Use any supported PHP version.
- Create a PHP file with:
<?php
$result = strtr('Hello :name', [
':name' => 'Alex',
]);
- Open the file with PHPantom enabled.
- Check diagnostics on the second argument.
Error output or panic trace
.phpantom.toml
No version-specific settings are required.
Additional context
strtr() has two valid signatures:
strtr(string $string, string $from, string $to): string
strtr(string $string, array $replace_pairs): string
PHPantom appears to validate the call against the three-argument string signature only.
Binary source
Originally observed in the VS Code extension v0.5.0. Reproduced with the extension-cached GitHub Releases binary
PHPantom version
phpantom_lsp 0.8.0-dirty
Installation method
Pre-built binary from GitHub Releases
Operating system
Windows x86_64
Editor
VS Code
Bug description
PHPantom reports a type mismatch for the valid two-argument
strtr()form where the second argument is the replacement-pairs array.Expected: no diagnostic.
Actual:
Argument 2 ($from) expects string, got array{...}with codetype_mismatch_argument.Steps to reproduce
Error output or panic trace
.phpantom.toml
No version-specific settings are required.
Additional context
strtr()has two valid signatures:PHPantom appears to validate the call against the three-argument string signature only.
Binary source
Originally observed in the VS Code extension v0.5.0. Reproduced with the extension-cached GitHub Releases binary