php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74922 Composed class has fatal error with duplicate, equal const properties
Submitted: 2017-07-14 05:31 UTC Modified: -
From: walle dot sthlm at gmail dot com Assigned:
Status: Closed Package: Class/Object related
PHP Version: Irrelevant OS: *
Private report: No CVE-ID: None
 [2017-07-14 05:31 UTC] walle dot sthlm at gmail dot com
Description:
------------
The following snippet results in the "definition differs and is considered incompatible" fatal error in 5.6+. Can this be considered as a bug? 

const VALUE = true;

trait Foo {public $var = VALUE;}
trait Bar {public $var = VALUE;}
class Baz {use Foo, Bar;}

https://3v4l.org/kkHFe


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-11-02 20:06 UTC] nikic@php.net
Automatic comment on behalf of mail@pmmaga.net
Revision: http://git.php.net/?p=php-src.git;a=commit;h=897bdb42f084e20eaf8a4b88829fc94f72626fd0
Log: Fix #74922 - Try to resolve constants when importing trait properties
 [2017-11-02 20:06 UTC] nikic@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC