php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73283 zip_open() expects exactly 1 parameter, 2 given
Submitted: 2016-10-10 12:00 UTC Modified: 2016-10-10 13:43 UTC
From: spam2 at rhsoft dot net Assigned: cmb (profile)
Status: Not a bug Package: zip (PECL)
PHP Version: 7.0.11 OS: Linux
Private report: No CVE-ID: None
 [2016-10-10 12:00 UTC] spam2 at rhsoft dot net
Description:
------------
WTF - how is one supposed to write a replacement for "PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; Archive_Zip has a deprecated constructor in /usr/share/pear/Archive/Zip.php on line 101" which is anyways laughable since __construct() exists for a decade
___________________________

Warning: zip_open() expects exactly 1 parameter, 2 given in /mnt/data/www/thelounge.net/contentlounge/cms/api_misc.php on line 1800

$zip_handle = zip_open($zip_filename, ZipArchive::CREATE);

http://php.net/manual/en/ziparchive.open.php
 flags

    The mode to use to open the archive.

        ZipArchive::OVERWRITE

        ZipArchive::CREATE

        ZipArchive::EXCL

        ZipArchive::CHECKCONS




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-10-10 12:08 UTC] spam2 at rhsoft dot net
are you kidding me?

procedural and object usage hebave different?

$zip = new ZipArchive();
$zip_handle = $zip->open($zip_filename, ZipArchive::CREATE);
 [2016-10-10 13:43 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2016-10-10 13:43 UTC] cmb@php.net
> Archive_Zip has a deprecated constructor

From <http://pear.php.net/package/Archive_Zip>:

| This package is not maintained anymore and has been superseded.
| Package has moved to channel pecl.php.net, package zip.

> procedural and object usage hebave different?

Yes, as it is documented. So, this is not a bug.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Jul 06 21:01:04 2020 UTC