Bug #75850 [NEW]: Incorrect PHAR stub parsing
| From: | anrdaemon at freemail dot ru | Date: | Sat, 20 Jan 2018 09:21:51 +0000 |
| Subject: | Bug #75850 [NEW]: Incorrect PHAR stub parsing | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-213627@lists.php.net to get a copy of this message | ||
From: anrdaemon at freemail dot ru
Operating system: unrelated
PHP version: 7.1.13
Package: PHAR related
Bug Type: Bug
Bug description:Incorrect PHAR stub parsing
Description:
------------
Unable to use stub with "?>" token present but ";" omitted after
__halt_compiler().
According to PHP parsing rules, "?>" implies ";". (In other words, the
stub itself executes cleanly, which makes it extra hard to realize the
source of confusion.)
At the very least, the error message could be clearer.
Test script:
---------------
<?php
(new Phar("test.phar"))->setStub("<?php __halt_compiler()?>");
Expected result:
----------------
A
test.phar example created.
Actual result:
--------------
PHP Fatal error: Uncaught PharException: illegal stub for phar
".../test.phar" in .../case2.php:3
Stack trace:
#0 .../case2.php(3): Phar->setStub('<?php __halt_co...')
#1 {main}
thrown in .../case2.php on line 3
--
Edit bug report at https://bugs.php.net/bug.php?id=75850&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75850&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75850&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75850&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75850&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75850&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75850&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75850&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75850&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75850&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75850&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75850&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75850&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75850&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75850&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75850&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75850&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75850&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75850&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75850&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75850&r=mysqlcfg