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-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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: klimplant at disroot dot org
New email:
PHP Version: OS:

 

 [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

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
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Jan 16 11:01:26 2019 UTC