note 93327 deleted from function.class-alias by sobak
| From: | sobak@php.net | Date: | Sat, 19 Nov 2016 05:33:27 +0000 |
| Subject: | note 93327 deleted from function.class-alias by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-207170@lists.php.net to get a copy of this message | ||
Note Submitter: paul [dot] kotets [at] gmail [dot] com
----
This function will appear in PHP 5.3 (at least I can use it with PHP 5.3, build Aug 7 2009 08:21:14)
For older versions of PHP I wrote the next function:
<?php
if (!function_exists('class_alias')) {
function class_alias($original, $alias) {
eval('abstract class ' . $alias . ' extends ' . $original . ' {}');
}
}
?>
Keyword 'abstract' is used for classes, which defines abstract methods.
This function is used in autoload purposes (when I extend classes), so abstract keyword doesn't
broke anything for me.