Bug #69164 [Opn]: Wrong error message when a trait extends another trait

From: Date: Tue, 03 Mar 2015 15:01:53 +0000
Subject: Bug #69164 [Opn]: Wrong error message when a trait extends another trait
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191088@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69164&edit=1

 ID:                 69164
 Updated by:         laruence@php.net
 Reported by:        sebastian@php.net
 Summary:            Wrong error message when a trait extends another
                     trait
 Status:             Open
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Irrelevant
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

This should only be in version 5.x..


Previous Comments:
------------------------------------------------------------------------
[2015-03-02 20:07:26] sebastian@php.net

Description:
------------
The error message for "trait extends trait" is wrong.

Test script:
---------------
<?php
trait t1
{
}

trait t2 extends t1
{
}


Expected result:
----------------
PHP Fatal error:  A trait (t2) cannot extend a trait. Traits can only be composed from other traits
with the 'use' keyword. Error in /home/sb/test.php on line 7

Actual result:
--------------
PHP Fatal error:  A trait (t2) cannot extend a class. Traits can only be composed from other traits
with the 'use' keyword. Error in /home/sb/test.php on line 7


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=69164&edit=1


Thread (4 messages)

« previous php.bugs (#191088) next »