php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54624 class_alias and type hint
Submitted: 2011-04-28 17:11 UTC Modified: 2011-06-12 23:10 UTC
From: david at grudl dot com Assigned: felipe (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3.6 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: david at grudl dot com
New email:
PHP Version: OS:

 

 [2011-04-28 17:11 UTC] david at grudl dot com
Description:
------------
class_alias() is not taken into account by type hints.

Note: there is eval(), so this is NOT PARSING-TIME error. Alias was created before eval is parsed.

Test script:
---------------
<?php

class A
{
	function foo(A $param) {
	}

}

class_alias('A', 'AliasA');

eval(' 
	class B extends A
	{
		function foo(AliasA $param) {
		}

	}
');

Expected result:
----------------
no error

Actual result:
--------------
Strict Standards: Declaration of B::foo() should be compatible with that of A::foo() 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-06-12 23:10 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=312112
Log: - Fixed bug #54624 (class_alias and type hint)
 [2011-06-12 23:10 UTC] felipe@php.net
-Summary: class_alias and type hint (II.) +Summary: class_alias and type hint -Status: Open +Status: Closed -Package: Compile Failure +Package: Scripting Engine problem -Assigned To: +Assigned To: felipe
 [2011-06-12 23:10 UTC] felipe@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/.
 
Thank you for the report, and for helping us make PHP better.


 [2012-04-18 09:50 UTC] laruence@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=a43b067172ce3cb8c768e94028d483641eef7d1e
Log: - Fixed bug #54624 (class_alias and type hint)
 [2012-07-24 23:41 UTC] rasmus@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=a43b067172ce3cb8c768e94028d483641eef7d1e
Log: - Fixed bug #54624 (class_alias and type hint)
 [2013-11-17 09:37 UTC] laruence@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=a43b067172ce3cb8c768e94028d483641eef7d1e
Log: - Fixed bug #54624 (class_alias and type hint)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC