Bug #70958 [Asn->Csd]: 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: Assigned
+Status: Closed
Type: Bug
Package: *General Issues
PHP Version: 7.0.0RC7
Assigned To: laruence
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=a2b85ddecf666281717e50246950fd6d153bb0a8
Log: Fixed bug #70958 (Invalid opcode while using ::class as trait method paramater default value)
Previous Comments:
------------------------------------------------------------------------
[2015-11-23 05:00:16] laruence@php.net
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
------------------------------------------------------------------------
[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)