Bug #73952 [Opn->Nab]: Reflection say interfaces are not cloneable
| From: | requinix@php.net | Date: | Tue, 17 Jan 2017 07:00:44 +0000 |
| Subject: | Bug #73952 [Opn->Nab]: Reflection say interfaces are not cloneable | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-206702@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73952&edit=1
ID: 73952
Updated by: requinix@php.net
Reported by: hidingitfrombots at example dot org
Summary: Reflection say interfaces are not cloneable
-Status: Open
+Status: Not a bug
Type: Bug
Package: Reflection related
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Interfaces cannot be constructed, therefore they cannot be cloned. Same goes for traits and abstract
classes. The existence and visibility of __clone only matters for regular classes.
Previous Comments:
------------------------------------------------------------------------
[2017-01-17 06:41:07] hidingitfrombots at example dot org
Description:
------------
$interfaceReflection->isCloneable() always returns false for interfaces.
But they are, as all types are cloneable by default unless one explicitly makes __clone non public.
Additionally, it returns false even if __clone is explicitly defined:
interface Baz{ function __clone(); }
$rc = new ReflectionClass(Baz::class);
var_dump($rc->isCloneable()); // false
thanks
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73952&edit=1