Bug #67778 [NEW]: Constructor overriding and derived classes

From: Date: Tue, 05 Aug 2014 17:05:35 +0000
Subject: Bug #67778 [NEW]: Constructor overriding and derived classes
Groups: php.standards 
Request: Send a blank email to standards-+get-332@lists.php.net to get a copy of this message
From: joelm Operating system: PHP version: Irrelevant Package: PHP Language Specification Bug Type: Bug Bug description:Constructor overriding and derived classes Description: ------------ https://github.com/php/php-langspec/blob/master/spec/14-classes.md#constructors "Constructors can be overridden in a derived class by redeclaring them. However, an overriding constructor need not have the same signature as defined in the base class." This is not accurate. If there is no abstract decl for __construct in the inheritance hierarchy, then the derived class can use whatever signature it wants. If there is an abstract decl for __construct in the inheritance hierarchy, then the derived class's __construct method needs to match the signature of the abstract decl. -- Edit bug report at https://bugs.php.net/bug.php?id=67778&edit=1 --

« previous php.standards (#332) next »