php.net |  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-02-11 00:00 UTC
From: klimplant at disroot dot org Assigned: girgias (profile)
Status: Closed Package: Class/Object related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
4 - 2 = ?
Subscribe to this entry?

 
 [2019-01-07 17:31 UTC] klimplant at disroot dot org
Description:
------------
---
From manual page: https://php.net/ziparchive.addfile
---
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)


Patches

doc-fix-77426 (last revision 2019-01-20 17:57 UTC by girgias@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-01-07 17:37 UTC] peehaa@php.net
-Status: Open +Status: Not a bug
 [2019-01-07 17:37 UTC] peehaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
 [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] requinix@php.net
-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] requinix@php.net
I would expect to see it with the docs for the new operator.
http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.new

Note the langspec does account for the syntax.
 [2019-01-11 02:40 UTC] girgias@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: girgias
 [2019-01-20 17:57 UTC] girgias@php.net
The following patch has been added/updated:

Patch Name: doc-fix-77426
Revision:   1548007056
URL:        https://bugs.php.net/patch-display.php?bug=77426&patch=doc-fix-77426&revision=1548007056
 [2019-02-11 00:00 UTC] pasindu@php.net
-Status: Assigned +Status: Closed
 [2019-02-11 00:00 UTC] pasindu@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

http://svn.php.net/viewvc?view=revision&revision=346784
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 20:01:29 2024 UTC