Page MenuHomePhabricator

Phan 3.2.6 crashed on composer-php81-docker test
Closed, ResolvedPublic

Description

17:44:40 > phan --allow-polyfill-parser --no-progress-bar
17:44:40 /src/vendor/phan/phan/src/Phan/Library/Map.php:37 [8192] Return type of Phan\Library\Map::key() should either be compatible with SplObjectStorage::key(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
17:44:40 (Phan 3.2.6 crashed)
17:44:40 More details:
17:44:40 #2: include() called at [/src/vendor/composer/ClassLoader.php:571] Args: ["/src/vendor/phan/phan/src/Phan/Bootstrap.php"]
17:44:40 #3: Composer\Autoload\includeFile() called at [/src/vendor/composer/ClassLoader.php:428] Args: ["/src/vendor/composer/../phan/phan/src/Phan/Library/Map.php"]
17:44:40 #4: Composer\Autoload\ClassLoader->loadClass() called at [/src/vendor/phan/phan/src/Phan/CodeBase.php:222] Args: ["Phan\\Library\\Map"]
17:44:40 #5: Phan\CodeBase->__construct() called at [/src/vendor/phan/phan/src/codebase.php:17] Args: [["stdClass", "InternalIterator", "Exception", "ErrorException", "Error", "CompileError", "ParseError", "TypeError", "ArgumentCountError", "ValueError", ... 223 more element(s)], ["Traversable", "IteratorAggregate", "Iterator", "Serializable", "ArrayAccess", "Countable", "Stringable", "Throwable", "UnitEnum", "BackedEnum", ... 38 more element(s)], ["Phan\\PluginV3\\IssueEmitter"], ["true", "false", "null", "E_ERROR", "E_RECOVERABLE_ERROR", "E_WARNING", "E_PARSE", "E_NOTICE", "E_STRICT", "E_DEPRECATED", ... 2524 more element(s)], ["zend_version", "func_num_args", "func_get_arg", "func_get_args", "strlen", "strcmp", "strncmp", "strcasecmp", "strncasecmp", "error_reporting", ... 1699 more element(s)]]
17:44:40 #6: require() called at [/src/vendor/phan/phan/src/phan.php:26] Args: ["/src/vendor/phan/phan/src/codebase.php"]
17:44:40 #7: require_once() called at [/src/vendor/phan/phan/phan:10] Args: ["/src/vendor/phan/phan/src/phan.php"]
17:44:40 #8: include() called at [/src/vendor/bin/phan:117] Args: ["/src/vendor/phan/phan/phan"]
17:44:40 PHP Fatal error:  Object of class UnwindExit could not be converted to string in /src/vendor/phan/phan/src/Phan/Library/Map.php on line 0
17:44:40 Script phan --allow-polyfill-parser --no-progress-bar handling the phan event returned with error code 255
17:44:40 Script @phan was called via test
17:44:41 Build step 'Execute shell' marked build as failure

Event Timeline

Looks like we need to upgrade phan for PHP 8.1 — looking at this change to the reported file (/src/vendor/phan/phan/src/Phan/Library/Map.php), they resolved the issue in v5.0.0 by the use of ReturnTypeWillChange, yet looking at that Jenkins run, we're using v3.2.6?

Change 793103 had a related patch set uploaded (by Hashar; author: Hashar):

[integration/docroot@master] build: update Phan for php 8.1 support

https://gerrit.wikimedia.org/r/793103

Change 793103 merged by jenkins-bot:

[integration/docroot@master] build: update Phan for php 8.1 support

https://gerrit.wikimedia.org/r/793103

Reassigning to @TheresNoTime who found out the reason above (T308692#7939339). I have merely pushed the button ;)