php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60173 Wrong message on trait instantiation
Submitted: 2011-10-30 00:06 UTC Modified: 2011-10-31 22:59 UTC
From: php-bugs at majkl578 dot cz Assigned: gron (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.4SVN-2011-10-29 (snap) OS:
Private report: No CVE-ID: None
 [2011-10-30 00:06 UTC] php-bugs at majkl578 dot cz
Description:
------------
Wrong error message when trait is being instanciated using reflection or being unserialized by unserialize().

Test script:
---------------
trait Test
{}

$rc = new ReflectionClass('Test');
$rc->newInstance();

Expected result:
----------------
Fatal error: Cannot instantiate trait Test in %s on line %d

Actual result:
--------------
Fatal error: Cannot instantiate abstract class Test in %s on line %d

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-10-31 22:28 UTC] gron@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: gron
 [2011-10-31 22:58 UTC] gron@php.net
Automatic comment from SVN on behalf of gron
Revision: http://svn.php.net/viewvc/?view=revision&revision=318621
Log: Fixed Bug #60173 (Wrong error message on reflective trait instantiation)
 [2011-10-31 22:59 UTC] gron@php.net
-Status: Assigned +Status: Closed
 [2011-10-31 22:59 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.

Fixed with SVN rev. 318621.
 [2012-04-18 09:48 UTC] laruence@php.net
Automatic comment on behalf of gron
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ada5cda0eccb6b33ff00178de06e7190fa7c7798
Log: Fixed Bug #60173 (Wrong error message on reflective trait instantiation)
 [2012-07-24 23:39 UTC] rasmus@php.net
Automatic comment on behalf of gron
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ada5cda0eccb6b33ff00178de06e7190fa7c7798
Log: Fixed Bug #60173 (Wrong error message on reflective trait instantiation)
 [2013-11-17 09:35 UTC] laruence@php.net
Automatic comment on behalf of gron
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ada5cda0eccb6b33ff00178de06e7190fa7c7798
Log: Fixed Bug #60173 (Wrong error message on reflective trait instantiation)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 10:01:29 2024 UTC