note 125352 added to migration72.new-features
| From: | info at ensostudio dot ru | Date: | Fri, 11 Sep 2020 19:28:12 +0000 |
| Subject: | note 125352 added to migration72.new-features | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-215100@lists.php.net to get a copy of this message | ||
Note: you cant change parameter type for abstract method defined in interface.
<?php
abstract class AbstractAssocArray imlements ArrayAccess
{
abstract public function offsetSet($offset, $value): void;
...
}
abstract class AbstractAssocArray2 extends AbstractAssocArray
{
abstract public function offsetSet(string $offset, $value): void;
}
class AssocArray extends AbstractAssocArray2
{
public function offsetSet(string $offset, $value): void
{
$this->{$offset} = $value;
}
}
?>
It's throw fatal error: Declaration of AbstractAssocArray::offsetSet(string $offset, $value):
void must be compatible with AbstractAssocArrayAccess::offsetSet($offset, $value).
----
Server IP: 45.112.84.4
Probable Submitter: 103.51.167.36 (proxied: 31.129.215.166)
----
Manual Page -- http://php.net/manual/en/migration72.new-features.php
Edit -- https://master.php.net/note/edit/125352
Del: integrated -- https://master.php.net/note/delete/125352/integrated
Del: useless -- https://master.php.net/note/delete/125352/useless
Del: bad code -- https://master.php.net/note/delete/125352/bad+code
Del: spam -- https://master.php.net/note/delete/125352/spam
Del: non-english -- https://master.php.net/note/delete/125352/non-english
Del: in docs -- https://master.php.net/note/delete/125352/in+docs
Del: other reasons-- https://master.php.net/note/delete/125352
Reject -- https://master.php.net/note/reject/125352
Search -- https://master.php.net/manage/user-notes.php