Doc #53509 [NEW]: Incorrect Phar Example; Confusing Results

From: Date: Thu, 09 Dec 2010 15:14:41 +0000
Subject: Doc #53509 [NEW]: Incorrect Phar Example; Confusing Results
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-5645@lists.php.net to get a copy of this message
From: Operating system: Linux PHP version: 5.3.3 Package: PHAR related Bug Type: Documentation Problem Bug description:Incorrect Phar Example; Confusing Results Description: ------------ --- From manual page: http://www.php.net/phardata.copy#Examples --- The output of the top half of the example claims to be "hi", but the output is actually "phar:///path/to/myphar.tar/b" What is the way with the least overhead to pull a file's content out of a PharData? I was hoping to be able to access the file content through the ArrayAccess, but so far only file_get_contents and readfile have worked. Thanks. Test script: --------------- <?php try { $phar = new PharData('myphar.tar'); $phar['a'] = 'hi'; $phar->copy('a', 'b'); echo $phar['b']; // outputs "hi" } catch (Exception $e) { // handle error } Expected result: ---------------- hi Actual result: -------------- phar:///path/to/myphar.tar/b -- Edit bug report at http://bugs.php.net/bug.php?id=53509&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53509&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53509&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53509&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53509&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53509&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53509&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53509&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53509&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53509&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53509&r=support Expected behavior: http://bugs.php.net/fix.php?id=53509&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53509&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53509&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53509&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53509&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53509&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53509&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53509&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53509&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53509&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53509&r=mysqlcfg

« previous php.doc.bugs (#5645) next »