|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79798 "Uncaught TypeError: Illegal offset type" with PHP 8.0-dev JIT on Windows
Submitted: 2020-07-06 07:50 UTC Modified: 2020-10-19 13:49 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: Assigned:
Status: Open Package: JIT
PHP Version: 8.0Git-2020-07-06 (Git) OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2020-07-06 07:50 UTC]
The error shown below is triggered while running the tests for PHPUnit 9.3 (master) with PHP 8.0-dev and JIT (opcache.enable=1, opcache.enable_cli=1, opcache.optimization_level=-1, opcache.jit=1205, opcache.jit_buffer_size=4096M) on Windows:

PHP Fatal error:  Uncaught TypeError: Illegal offset type in D:\a\phpunit\phpunit\vendor\phpunit\php-token-stream\src\Token\Stream.php:658
Stack trace:
#0 D:\a\phpunit\phpunit\vendor\phpunit\php-token-stream\src\Token\Stream.php(622): PHP_Token_Stream->addFunctionToMap()
#1 D:\a\phpunit\phpunit\vendor\phpunit\php-token-stream\src\Token\Stream.php(175): PHP_Token_Stream->parse()
#2 D:\a\phpunit\phpunit\vendor\phpunit\php-code-coverage\src\Node\File.php(478): PHP_Token_Stream->getClasses()
#3 D:\a\phpunit\phpunit\vendor\phpunit\php-code-coverage\src\Node\File.php(354): SebastianBergmann\CodeCoverage\Node\File->processClasses()
#4 D:\a\phpunit\phpunit\vendor\phpunit\php-code-coverage\src\Node\File.php(145): SebastianBergmann\CodeCoverage\Node\File->calculateStatistics()
#5 D:\a\phpunit\phpunit\vendor\phpunit\php-code-coverage\src\Node\Directory.php(165): SebastianBergmann\CodeCoverage\Node\File->__construct()
#6 D:\a\phpunit\phpunit\vendor\phpunit\php-code-coverage\src\Node\Builder.php(59): SebastianBergmann\CodeCoverage\Node\Directory->addFile()
#7 D:\a\phpunit\phpunit\vendor\phpunit\php-code-coverage\src\Node\Builder.php(63): SebastianBergmann\CodeCoverage\Node\Builder->addItems()
#8 D:\a\phpunit\phpunit\vendor\phpunit\php-code-coverage\src\Node\Builder.php(63): SebastianBergmann\CodeCoverage\Node\Builder->addItems()
#9 D:\a\phpunit\phpunit\vendor\phpunit\php-code-coverage\src\Node\Builder.php(63): SebastianBergmann\CodeCoverage\Node\Builder->addItems()
#10 D:\a\phpunit\phpunit\vendor\phpunit\php-code-coverage\src\Node\Builder.php(44): SebastianBergmann\CodeCoverage\Node\Builder->addItems()
#11 D:\a\phpunit\phpunit\vendor\phpunit\php-code-coverage\src\CodeCoverage.php(147): SebastianBergmann\CodeCoverage\Node\Builder->build()
#12 D:\a\phpunit\phpunit\vendor\phpunit\php-code-coverage\src\Report\Clover.php(55): SebastianBergmann\CodeCoverage\CodeCoverage->getReport()
#13 D:\a\phpunit\phpunit\src\TextUI\TestRunner.php(706): SebastianBergmann\CodeCoverage\Report\Clover->process()
#14 D:\a\phpunit\phpunit\src\TextUI\Command.php(134): PHPUnit\TextUI\TestRunner->run()
#15 D:\a\phpunit\phpunit\src\TextUI\Command.php(94): PHPUnit\TextUI\Command->run()
#16 D:\a\phpunit\phpunit\phpunit(61): PHPUnit\TextUI\Command::main()
#17 {main}
  thrown in D:\a\phpunit\phpunit\vendor\phpunit\php-token-stream\src\Token\Stream.php on line 658

This is the GitHub Action in question:

The code in question looks like this:

656    private function addFunctionToMap($name, $startLine, $endLine): void
656    {
657        for ($line = $startLine; $line <= $endLine; $line++) {
658            $this->lineToFunctionMap[$line] = $name;
659        }
660    }

The error is not triggered with PHP 8.0-dev and JIT on Linux (or with any other PHP configuration that is tested against in PHPUnit's CI pipeline).


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-10-15 12:45 UTC]
-Status: Open +Status: Feedback
 [2020-10-15 12:45 UTC]
Is this still an issue? At least looking at your GH actions, the jit config seems to be passing.
 [2020-10-16 05:08 UTC]
The php-token-stream library has been abandoned and is no longer used by PHPUnit / php-code-coverage. That explains why the issue (if it were still around, which I do not know) does not show up in CI.
 [2020-10-16 08:47 UTC]
-Package: Scripting Engine problem +Package: JIT
 [2020-10-19 13:49 UTC]
-Status: Feedback +Status: Open
 [2020-10-19 13:49 UTC]
Ah, I missed the fact that this is a Windows only issue, so of course it doesn't reproduce for me... Can't help then.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Sep 22 07:03:28 2021 UTC