|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53199 Phar doesn't work with '--enable-zend-multibyte' option
Submitted: 2010-10-29 10:22 UTC Modified: 2013-02-18 00:34 UTC
Avg. Score:4.7 ± 0.6
Reproduced:7 of 7 (100.0%)
Same Version:3 (42.9%)
Same OS:4 (57.1%)
From: brt dot river at gmail dot com Assigned:
Status: No Feedback Package: PHAR related
PHP Version: 5.3.3 OS: Mac OS X 10.6
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:
From: brt dot river at gmail dot com
New email:
PHP Version: OS:


 [2010-10-29 10:22 UTC] brt dot river at gmail dot com
I'm using PHP 5.3.3 with '--enable-zend-multibyte' under Mac OS X.
My script calls my phar archive directly, The result characters are garbled.

Test script:
* create.php
try {
    $phar = new Phar(dirname(__FILE__) . '/sample.phar');
    $phar->setStub('<?php echo "test" .PHP_EOL; __HALT_COMPILER();');
} catch (Exception $e) {
    echo 'Cannot open file: ', $e;

When I call this phar which I made like below, 
$ php create.php
$ php sample.phar

Expected result:
$ php sample.phar

Actual result:
$ php sample.phar

If I tried to use the version of PHP without '--enable-zend-multibyte', I got the expected result.
So I found that phar does not work with '--enable-zend-multibyte'.


phar.patch (last revision 2010-11-20 03:18 UTC by php at group dot apple dot com)
bug53199.patch (last revision 2010-11-18 07:47 UTC by

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-18 07:02 UTC] php at group dot apple dot com
I have been debugging a similar report with the phar CLI. Executing "php phar.php" 
(using the generated php/ext/phar/phar.php) works properly, but the resulting 
phar.phar does not. I have tried modifying the stub (via phar.php) to print 
debugging information but that only produces more "?" characters. Attempting to 
debug with Xdebug and MacGDBp wouldn't step through the first line before 
 [2010-11-18 08:47 UTC]
The following patch has been added/updated:

Patch Name: bug53199.patch
Revision:   1290066459
 [2010-11-18 08:48 UTC]
-Status: Open +Status: Feedback
 [2010-11-18 08:48 UTC]
Can you please see if the attached patch resolves the issue?

 [2010-11-18 09:51 UTC]
If it does indeed resolve the issue, this should be marked as duplicate of bug #42396.
 [2010-11-20 04:21 UTC] php at group dot apple dot com
The patch contained a logic flaw (compared against ptr and not size), so I 
reworked it to match the style of the other if-blocks in the function and have 
attached it as "phar.patch".

The patch file also contains a fix for Makefile.frag which removes $(INSTALL_ROOT) 
from the bang command path since INSTALL_ROOT is the mastering location, not the 
deployment location.
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Dec 06 14:03:34 2021 UTC