Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reproduce bug 10483 #10661

Open
wants to merge 12 commits into
base: 1.10.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/other-tests.yml
Expand Up @@ -407,6 +407,12 @@ jobs:
../../phpstan clear-result-cache -q
../../phpstan analyse --generate-baseline -q
../../phpstan analyse -vvv --fail-without-result-cache
- php-version: 7.2
ini-values: memory_limit=256M
operating-system: ubuntu-latest
script: |
cd e2e/bug10483
../../phpstan analyze

steps:
- name: "Checkout"
Expand Down
5 changes: 5 additions & 0 deletions e2e/bug10483/bootstrap.php
@@ -0,0 +1,5 @@
<?php

// constant that's used in the Filter extension that was introduced in a later version of PHP.
// on earlier php version introduce the same constant via a bootstrap file but with a wrong type
if(!defined("FILTER_SANITIZE_ADD_SLASHES"))define("FILTER_SANITIZE_ADD_SLASHES",false);
7 changes: 7 additions & 0 deletions e2e/bug10483/phpstan.dist.neon
@@ -0,0 +1,7 @@
parameters:
level: 9
paths:
- src

bootstrapFiles:
- bootstrap.php
5 changes: 5 additions & 0 deletions e2e/bug10483/src/bug10483.php
@@ -0,0 +1,5 @@
<?php

function doFoo(mixed $filter): void {
var_dump(filter_var("no", FILTER_VALIDATE_REGEXP));
}