|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-03-21 14:43 UTC] cataphract@php.net
-Type: Bug
+Type: Feature/Change Request
[2012-03-22 05:51 UTC] laruence@php.net
-Package: SPL related
+Package: Documentation problem
[2012-03-22 05:51 UTC] laruence@php.net
[2012-03-22 05:52 UTC] laruence@php.net
[2012-03-22 08:06 UTC] php at shark dot kom dot cz
[2013-10-09 06:07 UTC] krakjoe@php.net
[2013-10-09 06:07 UTC] krakjoe@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: krakjoe
[2013-10-09 06:07 UTC] krakjoe@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 08 15:00:01 2025 UTC |
Description: ------------ Function class_alias cannot create alias for standard classes. I'm using standard exceptions inspired by Java API for very long time. My exceptions was used earlier than exceptions introduced by SPL. I'd like to use SPL's exceptions instead of my exceptions in case they are defined, but I don't want to edit all codes to change exception names used. Therefor I'd like to use class_alias to act SPL exceptions as exceptions expected by applications. Test script: --------------- <?php class_alias('InvalidArgumentException', 'IllegalArgumentException'); // Application throw new IllegalArgumentException('Arg must be abcd') Expected result: ---------------- thrown IllegalArgumentException Actual result: -------------- PHP Warning: First argument of class_alias() must be a name of user defined class in aliases.php:17 Fatal error: Class 'IllegalArgumentException' not found in aliases.php on line 28