Skip to content

Commit 61ed904

Browse files
committed
Fix #75850: Unclear error message wrt. __halt_compiler() w/o semicolon
We add the failure reason to the error message. Closes GH-6638.
1 parent 3f183bb commit 61ed904

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? 2021, PHP 7.4.16
44

5+
- Phar:
6+
. Fixed bug #75850 (Unclear error message wrt. __halt_compiler() w/o
7+
semicolon) (cmb)
8+
59
- Zip:
610
. Fixed bug #80648 (Fix for bug 79296 should be based on runtime version).
711
(cmb, Remi)

ext/phar/phar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2602,7 +2602,7 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv
26022602
}
26032603
php_stream_close(newfile);
26042604
if (error) {
2605-
spprintf(error, 0, "illegal stub for phar \"%s\"", phar->fname);
2605+
spprintf(error, 0, "illegal stub for phar \"%s\" (__HALT_COMPILER(); is missing)", phar->fname);
26062606
}
26072607
if (free_user_stub) {
26082608
zend_string_free(suser_stub);

ext/phar/tests/phar_stub_error.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ __HALT_COMPILER();
4848
string(48) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>"
4949
string(48) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>"
5050
bool(true)
51-
Exception: illegal stub for phar "%sphar_stub_error.phar.php"
51+
Exception: illegal stub for phar "%sphar_stub_error.phar.php" (__HALT_COMPILER(); is missing)
5252
string(48) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>"
5353
bool(true)
5454
string(48) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>"

0 commit comments

Comments
 (0)