ERROR 8192: Array and string offset access syntax with curly braces is deprecated at [libphutil/externals/porter-stemmer/src/Porter.php:424]

I reparsed my repository (./repository reparse --all Rx --change --message) and during that the following error message was shown three times:

ERROR 8192: Array and string offset access syntax with curly braces is deprecated at [/srv/www/htdocs/phalacity/libphutil/externals/porter-stemmer/src/Porter.php:422]
arcanist(head=master, ref.master=cc850163f30c), phabricator(head=master, ref.master=33c534f9b74f), phutil(head=master, ref.master=39ed96cd818a)
  #0 require_once called at [<phutil>/src/search/PhutilSearchStemmer.php:57]
  #1 PhutilSearchStemmer::applyStemmer(string) called at [<phutil>/src/search/PhutilSearchStemmer.php:28]
  #2 PhutilSearchStemmer::stemCorpus(string) called at [<phabricator>/src/applications/search/engineextension/PhabricatorFerretFulltextEngineExtension.php:92]
  #3 PhabricatorFerretFulltextEngineExtension::indexFulltextObject(ManiphestTask, PhabricatorSearchAbstractDocument) called at [<phabricator>/src/applications/search/index/PhabricatorFulltextEngine.php:51]
  #4 PhabricatorFulltextEngine::buildFulltextIndexes() called at [<phabricator>/src/applications/search/engineextension/PhabricatorFulltextIndexEngineExtension.php:51]
  #5 PhabricatorFulltextIndexEngineExtension::indexObject(ManiphestTaskFulltextEngine, ManiphestTask) called at [<phabricator>/src/applications/search/index/PhabricatorIndexEngine.php:78]
  #6 PhabricatorIndexEngine::indexObject() called at [<phabricator>/src/applications/search/worker/PhabricatorSearchWorker.php:84]
  #7 PhabricatorSearchWorker::doWork() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:124]
  #8 PhabricatorWorker::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:163]
  #9 PhabricatorWorker::scheduleTask(string, array, array) called at [<phabricator>/src/applications/search/worker/PhabricatorSearchWorker.php:23]
  #10 PhabricatorSearchWorker::queueDocumentForIndexing(string, array) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1501]
  #11 PhabricatorApplicationTransactionEditor::publishTransactions(ManiphestTask, array) called at [<phabricator>/src/applications/transactions/worker/PhabricatorApplicationTransactionPublishWorker.php:21]
  #12 PhabricatorApplicationTransactionPublishWorker::doWork() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:124]
  #13 PhabricatorWorker::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:163]
  #14 PhabricatorWorker::scheduleTask(string, array, array) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1461]
  #15 PhabricatorApplicationTransactionEditor::queuePublishing() called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1386]
  #16 PhabricatorApplicationTransactionEditor::applyTransactions(ManiphestTask, array) called at [<phabricator>/src/applications/diffusion/worker/DiffusionUpdateObjectAfterCommitWorker.php:144]
  #17 DiffusionUpdateObjectAfterCommitWorker::updateTask(PhabricatorRepositoryCommit, ManiphestTask) called at [<phabricator>/src/applications/diffusion/worker/DiffusionUpdateObjectAfterCommitWorker.php:55]
  #18 DiffusionUpdateObjectAfterCommitWorker::doWork() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:124]
  #19 PhabricatorWorker::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:163]
  #20 PhabricatorWorker::scheduleTask(string, array, array) called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:259]
  #21 PhabricatorWorker::flushTaskQueue() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:164]
  #22 PhabricatorWorker::scheduleTask(string, array, array) called at [<phabricator>/src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php:260]
  #23 PhabricatorRepositoryManagementReparseWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:457]
  #24 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:349]
  #25 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/repository/manage_repositories.php:22]

This refers to the last lines of the code snippet below:

    private static function cvc($str)
    {   
        $c = self::$regex_consonant;
        $v = self::$regex_vowel;

        return     preg_match("#($c$v$c)$#", $str, $matches)
               AND strlen($matches[1]) == 3
               AND $matches[1]{2} != 'w'
               AND $matches[1]{2} != 'x'
               AND $matches[1]{2} != 'y';
    }

A repeated reparse didn’t throw this message.

Versions:

PHP 7.4.1
phabricator

33c534f9b74f5aa8c9491c875292ca31a4bdc84f (Nov 26 2019)

arcanist

cc850163f30c4697e925df0d6212469679600a2c (Nov 19 2019)

phutil

39ed96cd818aae761ec92613a9ba0800824d0ab0 (Sep 30 2019)

php

7.4.1

diff

3.7 at /usr/bin/diff

git

2.24.1 at /usr/bin/git

hg

5.2.1 at /usr/bin/hg

pygmentize

2.4.2 at /usr/bin/pygmentize

svn

1.13.0 at /usr/bin/svn

Thanks, I filed this upstream as https://secure.phabricator.com/T13472.

This should be fixed by https://secure.phabricator.com/D20941.

Locally, I’m not on a new enough version of PHP to actually get the warning. I believe my fix is right, but I might have overlooked something.

If you have huge amounts of free time and strongly desire to be more thorough about this than I’m being, you can test this change like this:

  • Create a task with the word “filing” in the title. This word will reach the relevant part of the stemmer (lots of other words work too, this was just the example in the original paper).
  • Run bin/search index --force Txxx, where Txxx is the task you created in the first step.
  • This should reproduce the warning.
  • Upgrade Phabricator.
  • Run bin/search index --force Txxx again. You should no longer receive a warning.

Thank you for the quick fix.

I could reproduce the warning with the word “filing” in title each time the indexer ran, then after Phabricator upgrade the issue indeed went away.

Great! Thanks for the work verifying the fix. Let us know if you run into anything else.