Bug #75607 [Ver->Csd]: b/c break in traits causes fatal error

From: Date: Sat, 16 Dec 2017 16:11:28 +0000
Subject: Bug #75607 [Ver->Csd]: b/c break in traits causes fatal error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213130@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75607&edit=1 ID: 75607 Updated by: nikic@php.net Reported by: stuart at stuartherbert dot com Summary: b/c break in traits causes fatal error -Status: Verified +Status: Closed Type: Bug Package: Class/Object related Operating System: Ubuntu 17.10 PHP Version: 7.2.0 Assigned To: pmmaga Block user comment: N Private report: N New Comment: Automatic comment on behalf of mail@pmmaga.net Revision: http://git.php.net/?p=php-src.git;a=commit;h=83964e0468e7f4ae39cd1435f3b53f62e174ac21 Log: Fix #75607 - Check if existing static trait property is a ref before comparing Previous Comments: ------------------------------------------------------------------------ [2017-12-01 21:31:45] pmmaga@php.net I've added a PR with a fix for the issue. ------------------------------------------------------------------------ [2017-11-30 21:41:38] stuart at stuartherbert dot com Description: ------------ In 7.2.0, using two traits that define the same static property cause a fatal error. Only static properties are affected. I've put this up on https://3v4l.org/oi4ns to show the behaviour on different PHP versions. I couldn't find this documented in the PHP 7.2.0 release notes / migration guide. Test script: --------------- https://3v4l.org/oi4ns <?php trait T1 { public static $prop1 = 1; } trait T2 { public static $prop1 = 1; } class Base { use T1; } class Child extends base { use T2; } Expected result: ---------------- Expected behaviour: - no fatal errors, no warnings, code executes Actual result: -------------- Actual behaviour: - fatal error: Fatal error: Base and T2 define the same property ($prop1) in the composition of Child. However, the definition differs and is considered incompatible. Class was composed in /in/oi4ns on line 18 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75607&edit=1

« previous php.bugs (#213130) next »