Doc #77426 [Nab->Opn]: Parentheses and argument list optional with new operator

From: Date: Mon, 07 Jan 2019 20:36:05 +0000
Subject: Doc #77426 [Nab->Opn]: Parentheses and argument list optional with new operator
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-16309@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: requinix@php.net Reported by: klimplant at disroot dot org -Summary: missing brackets in zipArchive::addFile documentation +Summary: Parentheses and argument list optional with new operator -Status: Not a bug +Status: Open Type: Documentation Problem -Package: Documentation problem +Package: Class/Object related PHP Version: Irrelevant Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.doc.bugs (#16309) next »