Doc #77426 [Opn->Asn]: Parentheses and argument list optional with new operator
| From: | girgias@php.net | Date: | Fri, 11 Jan 2019 02:40:13 +0000 |
| Subject: | Doc #77426 [Opn->Asn]: Parentheses and argument list optional with new operator | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-16318@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77426&edit=1
ID: 77426
Updated by: girgias@php.net
Reported by: klimplant at disroot dot org
Summary: Parentheses and argument list optional with new
operator
-Status: Open
+Status: Assigned
Type: Documentation Problem
Package: Class/Object related
PHP Version: Irrelevant
-Assigned To:
+Assigned To: girgias
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2019-01-07 20:36:05] 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-07 20:16:39] 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 17:37:12] 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 17:31:15] 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)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77426&edit=1