Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

class_alias

Description

The class_alias of Class / Object for PHP 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

1 · original alias

<?

class myclass1
{
}

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

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

var_export($return);

?>
true

2 · autoload

<?

class myclass1
{
}

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

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

var_export($return);

?>
true
HomeMenu