xp-framework/core

XAR files: syntax error, unexpected end of file

thekid opened this issue · 6 comments

$ XP_RT=7.4 xp -cp test.xar xp.unittest.Runner src/test/config/unittest/core.ini
Uncaught exception: ParseError (syntax error, unexpected end of file)
  at <source> [line 277 of xar://.\test.xar?xp/unittest/Runner.class.php]
  at <main>('src/test/config/unittest/core.ini') [line 0 of xp.unittest.Runner]
  at lang.AbstractClassLoader->loadClass0('xp.unittest.Runner') [line 444 of lang.base.php]
  at <main>::{closure}('xp\\unittest\\Runner') [line 0 of (unknown)]
  at <main>::spl_autoload_call('xp\\unittest\\Runner') [line 0 of (unknown)]
  at <main>::is_callable(array[2]) [line 369 of class-main.php]

With PHP 7.3, no error occurs.

Wow, this fixes the problem:

-$r= include($this->classUri($class));
+$r= eval("?>".file_get_contents($this->classUri($class)));

Hrm, maybe some of the stream wrapper code might have been changed?

image

If I tee the read bytes from within the XAR file wrapper to standard output, this is how far the file is read... line 277.

This might be the indicator of what's going wrong:

$ ls -al Runner.php
-rw----r-- 1 Timm Timm 8192 Jul 28 12:50 Runner.php
#                      ^^^^

Opened bug report in PHP project -> https://bugs.php.net/bug.php?id=78340

Might be related to php/php-src@d59aac5

Bug fixed, all PHP versions are green once again