Bug #70957 [NEW]: self::class can not be resolved with reflection for abstract class
From: lisachenko dot it at gmail dot com
Operating system:
PHP version: 5.6.15
Package: Reflection related
Bug Type: Bug
Bug description:self::class can not be resolved with reflection for abstract class
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 bug report at https://bugs.php.net/bug.php?id=70957&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70957&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70957&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70957&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70957&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70957&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70957&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70957&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70957&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70957&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70957&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70957&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70957&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70957&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70957&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70957&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70957&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70957&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70957&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70957&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70957&r=mysqlcfg
Thread (3 messages)
- lisachenko dot it at gmail dot com