|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70958 Invalid opcode while using ::class as trait method paramater default value
Submitted: 2015-11-23 04:58 UTC Modified: 2015-11-23 05:00 UTC
From: Assigned: laruence (profile)
Status: Closed Package: *General Issues
PHP Version: 7.0.0RC7 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2015-11-23 04:58 UTC]
See test script

Test script:

trait Foo
    function bar($a = self::class) {}

class B {
    use Foo;

$b = new B;


Expected result:
string(1) "C"

Actual result:
PHP-5.6: Fatal error: Invalid opcode 64/8/2. in /tmp/1.php on line 5
[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 ===


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-11-23 05:00 UTC]
-Assigned To: +Assigned To: laruence
 [2015-11-23 05:00 UTC]
a quick fix is here:

however, the reflection and other similar functions which exporting fucntion declaration function should also be fixed later
 [2015-11-23 10:35 UTC]
Automatic comment on behalf of
Log: Fixed bug #70958 (Invalid opcode while using ::class as trait method paramater default value)
 [2015-11-23 10:36 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Sep 26 17:08:01 2022 UTC