IT. Expert System.

PHP

Creates an alias for a class


class_alias

(PHP 5 >= 5.3.0)

class_aliasCreates an alias for a class

Description

bool class_alias ([ string $original [, string $alias ]] )

Creates an alias named alias based on the defined class original. The aliased class is exactly the same as the original class.

Parameters

original

The original class.

alias

The alias name for the class.

Return Values

Returns TRUE on success or FALSE on failure.

Examples

Example #1 class_alias() example

<?php

class foo { }

class_alias('foo''bar');

$a = new foo;
$b = new bar;

// the objects are the same
var_dump($a == $b$a === $b);
var_dump($a instanceof $b);

// the classes are the same
var_dump($a instanceof foo);
var_dump($a instanceof bar);

var_dump($b instanceof foo);
var_dump($b instanceof bar);

?>

The above example will output:

 bool(true) bool(false) bool(true) bool(true) bool(true) bool(true) bool(true) 

See Also



Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 330 / 158766790. Delta: 0.03334 с