From 5130563d9febc45a0135a9794c2fa9e841f4e7cd Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Tue, 28 Feb 2023 19:06:07 -0400 Subject: [PATCH] Revert "`array_pop` is impure" --- src/Psalm/Internal/Codebase/Functions.php | 1 - tests/PureAnnotationTest.php | 24 ----------------------- 2 files changed, 25 deletions(-) diff --git a/src/Psalm/Internal/Codebase/Functions.php b/src/Psalm/Internal/Codebase/Functions.php index a86d9aec9..50e3f60fb 100644 --- a/src/Psalm/Internal/Codebase/Functions.php +++ b/src/Psalm/Internal/Codebase/Functions.php @@ -476,7 +476,6 @@ class Functions 'date_default_timezone_set', 'assert_options', 'setlocale', 'set_exception_handler', 'set_time_limit', 'putenv', 'spl_autoload_register', 'spl_autoload_unregister', 'microtime', 'array_rand', 'set_include_path', - 'array_pop', // logging 'openlog', 'syslog', 'error_log', 'define_syslog_variables', diff --git a/tests/PureAnnotationTest.php b/tests/PureAnnotationTest.php index 954173abb..11f3a9942 100644 --- a/tests/PureAnnotationTest.php +++ b/tests/PureAnnotationTest.php @@ -902,30 +902,6 @@ class PureAnnotationTest extends TestCase ', 'error_message' => 'ImpureFunctionCall', ], - 'array_popIsNotMutationFree' => [ - 'code' => <<<'PHP' - */ - private array $stack = []; - - public function push(string $item): void - { - $this->stack[] = $item; - } - - /** @psalm-mutation-free */ - public function next(): string|null - { - return array_pop($this->stack); - } - } - PHP, - 'error_message' => 'ImpureFunctionCall', - 'ignored_issues' => [], - 'php_version' => '8.0', - ], ]; } }