Bug #70957 [Opn]: self::class can not be resolved with reflection for abstract class

From: Date: Mon, 23 Nov 2015 03:47:29 +0000
Subject: Bug #70957 [Opn]: self::class can not be resolved with reflection for abstract class
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-197374@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70957&edit=1 ID: 70957 Updated by: laruence@php.net Reported by: lisachenko dot it at gmail dot com Summary: self::class can not be resolved with reflection for abstract class Status: Open Type: Bug Package: Reflection related PHP Version: 5.6.15 -Assigned To: +Assigned To: laruence Block user comment: N Private report: N New Comment: 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; } Previous Comments: ------------------------------------------------------------------------ [2015-11-22 19:34:42] 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70957&edit=1

« previous php.bugs (#197374) next »