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

From: Date: Mon, 15 Jan 2018 11:42:30 +0000
Subject: Bug #69164 [Opn->Csd]: Wrong error message when a trait extends another trait
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213542@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:         nikic@php.net
 Reported by:        sebastian@php.net
 Summary:            Wrong error message when a trait extends another
                     trait
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Irrelevant
 PHP Version:        Irrelevant
-Assigned To:        
+Assigned To:        nikic
 Block user comment: N
 Private report:     N

 New Comment:

5.x is no longer supported, so closing this. In 7.x this is a parse error.


Previous Comments:
------------------------------------------------------------------------
[2015-03-03 15:09:56] sebastian@php.net

Yes, seems like the error message was changed for PHP 7: http://3v4l.org/k33mV

Would be nice, though, to have this in all supported branches.

------------------------------------------------------------------------
[2015-03-03 15:01:53] laruence@php.net

This should only be in version 5.x..

------------------------------------------------------------------------
[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 (#213542) next »