class can not be resolved with reflection for abstract class
| Bug #70957 | self::class can not be resolved with reflection for abstract class | ||||
|---|---|---|---|---|---|
| Submitted: | 2015-11-22 19:34 UTC | Modified: | 2015-11-23 03:47 UTC | ||
| From: | lisachenko dot it at gmail dot com | Assigned: | laruence (profile) | ||
| Status: | Closed | Package: | Reflection related | ||
| PHP Version: | 5.6.15 | OS: | |||
| Private report: | No | CVE-ID: | None | ||
[2015-11-22 19:34 UTC] lisachenko dot it at gmail dot com
Description: ------------ Can not export reflection method in the abstract class to the string value for method with default parameter, equals to 'self::class' See https://3v4l.org/3TdIg, reproduced in all latest 5.6 versions. Test script: --------------- <?php abstract class Foo { private function bar($a = self::class) {} } $refMethod = new \ReflectionMethod('Foo', 'bar'); echo "Exported: ", $refMethod; Expected result: ---------------- Exported: Method [ <user> private method bar ] { @@ /in/3TdIg 5 - 5 - Parameters [1] { Parameter #0 [ <optional> $a = 'Foo' ] } } Actual result: -------------- Exported: Process exited with code 139.
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2015-11-23 03:47 UTC] laruence@php.net
actually, this is not only about refelction, see also: <?php abstract class Foo { function bar($a = self::class) {} } trait T { public function bar() { } } class Bar extends Foo { use T; }