Bug #70958 [Opn]: Invalid opcode while using ::class as trait method paramater default value
Edit report at https://bugs.php.net/bug.php?id=70958&edit=1
ID: 70958
Updated by: laruence@php.net
Reported by: laruence@php.net
Summary: Invalid opcode while using ::class as trait method
paramater default value
Status: Open
Type: Bug
Package: *General Issues
PHP Version: 7.0.0RC7
-Assigned To:
+Assigned To: laruence
Block user comment: N
Private report: N
New Comment:
a quick fix is here: http://pastebin.com/iWZksF59
however, the reflection and other similar functions which exporting fucntion declaration function
should also be fixed later
Previous Comments:
------------------------------------------------------------------------
[2015-11-23 04:58:27] laruence@php.net
Description:
------------
See test script
Test script:
---------------
<?php
trait Foo
{
function bar($a = self::class) {}
}
class B {
use Foo;
}
$b = new B;
$b->bar();
Expected result:
----------------
string(1) "C"
Actual result:
--------------
PHP-5.6: Fatal error: Invalid opcode 64/8/2. in /tmp/1.php on line 5
PHP-7.0: NULL
[Mon Nov 23 12:39:01 2015] Script: '/tmp/1.php'
/home/huixinchen/opensource/php-7.0/Zend/zend_string.h(121) : Freeing 0x7FFFF8059B80 (32 bytes),
script=/tmp/1.php
=== Total 1 memory leaks detected ===
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70958&edit=1
Thread (3 messages)