php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60717 Order of traits in use statement can cause a fatal error
Submitted: 2012-01-11 17:24 UTC Modified: 2012-03-04 18:26 UTC
From: Jared dot Williams1 at ntlworld dot com Assigned: gron (profile)
Status: Closed Package: Class/Object related
PHP Version: 5.4.0RC5 OS: Ubuntu 11.10
Private report: No CVE-ID: None
 [2012-01-11 17:24 UTC] Jared dot Williams1 at ntlworld dot com
Description:
------------
The fatal trigger only occurs when the order of the use statement is

class HTMLHelper implements Helper
{
  use TextUTF8, TextArea, HTMLAttributes;
}

If the use statement is reordered... 

class HTMLHelper implements Helper
{
  use TextArea, HTMLAttributes, TextUTF8;
}

then code is fine. 

I guess that some testing of abstract methods is missing somewhere?



Test script:
---------------
https://gist.github.com/1595674

Expected result:
----------------
No fatal error

Actual result:
--------------
PHP Fatal error:  Can't inherit abstract function HTML\HTMLAttributes::text() 
(previously declared abstract in HTML\TextArea) in 
/var/www/framework.localhost/htdocs/bug.php on line 55


Patches

Fix-conflict-detection.patch (last revision 2012-01-30 23:00 UTC by gron@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-01-22 19:53 UTC] rasmus@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: gron
 [2012-01-30 23:00 UTC] gron@php.net
The following patch has been added/updated:

Patch Name: Fix-conflict-detection.patch
Revision:   1327964429
URL:        https://bugs.php.net/patch-display.php?bug=60717&patch=Fix-conflict-detection.patch&revision=1327964429
 [2012-03-04 18:26 UTC] gron@php.net
Automatic comment from SVN on behalf of gron
Revision: http://svn.php.net/viewvc/?view=revision&revision=323891
Log: Fixed Bug #60717 (Order of traits in use statement can cause a fatal error)
# Compatibility is now correctly checked in both directions.
# Introduced helper method for the test.
 [2012-03-04 18:26 UTC] gron@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-03-04 18:26 UTC] gron@php.net
-Status: Assigned +Status: Closed
 [2012-04-18 09:45 UTC] laruence@php.net
Automatic comment on behalf of gron
Revision: http://git.php.net/?p=php-src.git;a=commit;h=0bb85e4b91a21635d07ee2ae504ca2a4abc0d571
Log: Fixed Bug #60717 (Order of traits in use statement can cause a fatal error) # Compatibility is now correctly checked in both directions. # Introduced helper method for the test.
 [2012-07-24 23:36 UTC] rasmus@php.net
Automatic comment on behalf of gron
Revision: http://git.php.net/?p=php-src.git;a=commit;h=0bb85e4b91a21635d07ee2ae504ca2a4abc0d571
Log: Fixed Bug #60717 (Order of traits in use statement can cause a fatal error) # Compatibility is now correctly checked in both directions. # Introduced helper method for the test.
 [2013-11-17 09:33 UTC] laruence@php.net
Automatic comment on behalf of gron
Revision: http://git.php.net/?p=php-src.git;a=commit;h=0bb85e4b91a21635d07ee2ae504ca2a4abc0d571
Log: Fixed Bug #60717 (Order of traits in use statement can cause a fatal error) # Compatibility is now correctly checked in both directions. # Introduced helper method for the test.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 05:01:29 2024 UTC