|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #77426 Parentheses and argument list optional with new operator
Submitted: 2019-01-07 17:31 UTC Modified: 2019-01-11 02:40 UTC
From: klimplant at disroot dot org Assigned: girgias (profile)
Status: Assigned Package: Class/Object related
PHP Version: Irrelevant OS:
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: klimplant at disroot dot org
New email:
PHP Version: OS:


 [2019-01-07 17:31 UTC] klimplant at disroot dot org
From manual page:
On the man page for ZipArchive::addFile a new archive is created by using `$zip = new ZipArchive;`, while it should be `$zip = new ZipArchive();` (notice the opening and closing brackets)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-01-07 17:37 UTC]
-Status: Open +Status: Not a bug
 [2019-01-07 17:37 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at
 [2019-01-07 20:16 UTC] a at b dot c dot de
Parentheses are not required after the class name when there are no arguments to be passed to the constructor.

However, this is not mentioned when object creation is described (under "The Basics") nor under "Constructors and Destructors".
 [2019-01-07 20:36 UTC]
-Summary: missing brackets in zipArchive::addFile documentation +Summary: Parentheses and argument list optional with new operator -Status: Not a bug +Status: Open -Package: Documentation problem +Package: Class/Object related
 [2019-01-07 20:36 UTC]
I would expect to see it with the docs for the new operator.

Note the langspec does account for the syntax.
 [2019-01-11 02:40 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: girgias
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Jan 16 11:01:26 2019 UTC