|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-10-23 07:49 UTC] remi@php.net
-Status: Open
+Status: Not a bug
[2013-10-23 07:49 UTC] remi@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 19:00:01 2025 UTC |
Description: ------------ Currently the 'extractTo' method of the class 'ZipArchive' accepts two parameters, a destination and a entries parameter. The entries parameter is allowed to be NULL. however when invoked like below, warnings are thrown about the optinal argument making it hard to extend ZipArchive in some points. Extension Version => $Id: php_zip.c,v 1.1.2.43 2008/01/18 00:51:38 pajoye Exp $ Zip version => 1.8.11 Libzip version => 0.8.0-compatible Reproduce code: --------------- function funkyExtract($destination, $entries = NULL) { $za = new ZipArchive; $za->open('fubar.zip'); $za->extractTo($destination, $entries); $za->close(); } funkyExtract('./'); Actual result: -------------- PHP Warning: ZipArchive::extractTo(): Invalid argument, expect string or array of strings in /tmp/ziparchive.php on line 7 PHP Stack trace: PHP 1. {main}() /tmp/ziparchive.php:0 PHP 2. funkyExtract($destination = './', $entries = *uninitialized*) /tmp/ziparchive.php:11 PHP 3. ZipArchive->extractTo('./', NULL) /tmp/ziparchive.php:7 Warning: ZipArchive::extractTo(): Invalid argument, expect string or array of strings in /tmp/ziparchive.php on line 7 Call Stack: 0.0009 50052 1. {main}() /tmp/ziparchive.php:0 0.0010 50100 2. funkyExtract(string(2), ???) /tmp/ziparchive.php:11 0.0011 50540 3. ZipArchive->extractTo(string(2), null) /tmp/ziparchive.php:7 Variables in local scope (#2): $entries = NULL $destination = './' $za = class ZipArchive { public $status = 0; public $statusSys = 0; public $numFiles = 1; public $filename = ''; public $comment = '' }