Home Menu

class_alias

Creates an alias for a class

Syntax

class_alias ( string $original , string $alias [, bool $autoload = TRUE ] ) : bool

Parameters

original

The original class.

alias

The alias name for the class.

autoload

Whether to autoload if the original class is not found.

Return

Returns TRUE on success or FALSE on failure.

Examples

original alias

<?

class myclass1
{
}

$original = "myclass1";
$alias = "myclass2";

$return = class_alias($original, $alias);

var_export($return);

?>
true

autoload

<?

class myclass1
{
}

$original = "myclass1";
$alias = "myclass2";
$autoload = false;

$return = class_alias($original, $alias, $autoload);

var_export($return);

?>
true

PHP

JesusBible
HTMLCSSJSPHPSVGMore
AboutTerms