note 119406 added to language.oop5.abstract
| From: | Malcolm | Date: | Sun, 29 May 2016 13:26:46 +0000 |
| Subject: | note 119406 added to language.oop5.abstract | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-205613@lists.php.net to get a copy of this message | ||
I've found an inconsistency with: Example #2 Abstract class example
If you remove the default value of $separator
<?php
public function prefixName($name, $separator) {
// ...
}
?>
Then php will show this fatal message:
Fatal error: Declaration of ConcreteClass::prefixName() must be compatible with
AbstractClass::prefixName($name) in /index.php on line 23
Stange enough it gives an incorrect declaration of "ConcreteClass::prefixName()"... It is
missing both arguments. Because of that I'm assuming that this is just a bug that maybe already
has been taking care of in newer versions. (Or is just specific to my version) I'm mainly
noting this because it was driving me absolutely insane in some test code that I was writing derived
from Example #2 (without a default value for an extra argument). Perhaps this saves some
frustrations to other people.
--
Please note that i'm running this on php5.5.
OS: ubuntu-16.04-server-amd64.iso
Repo: ppa:ondrej/php
# php5.5 --version
PHP 5.5.36-2+donate.sury.org~xenial+1 (cli)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies with Zend OPcache v7.0.6-dev,
Copyright (c) 1999-2015, by Zend Technologies
----
Server IP: 72.52.91.14
Probable Submitter: 31.201.12.60
----
Manual Page -- http://php.net/manual/en/language.oop5.abstract.php
Edit -- https://master.php.net/note/edit/119406
Del: integrated -- https://master.php.net/note/delete/119406/integrated
Del: useless -- https://master.php.net/note/delete/119406/useless
Del: bad code -- https://master.php.net/note/delete/119406/bad+code
Del: spam -- https://master.php.net/note/delete/119406/spam
Del: non-english -- https://master.php.net/note/delete/119406/non-english
Del: in docs -- https://master.php.net/note/delete/119406/in+docs
Del: other reasons-- https://master.php.net/note/delete/119406
Reject -- https://master.php.net/note/reject/119406
Search -- https://master.php.net/manage/user-notes.php