Skip to content

Commit

Permalink
Test invalidated object in static closure
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm authored and ondrejmirtes committed Mar 20, 2024
1 parent 9bb4ef9 commit 255fbff
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/PHPStan/Analyser/data/bug-10566.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,22 @@ public function run7(): void
}
}

function run8(): void
{
$s = new self();

while ($s->running) {
assertType('true', $s->running);
call_user_func(static function () use ($s) {
$s->stop();
});
assertType('bool', $s->running);

if (!$s->running) {
$timeout = 0;
break;
}
}
}

}

0 comments on commit 255fbff

Please sign in to comment.