MENU
Members
| class_alias($s1,$s2) | creates an alias $s2 for the class $s1. |
| get_called_class() | returns the name of the class the method is called in. |
| get_object_ vars($o) | returns an associative array of the non-static properties of the object $o. |
| get_class_ vars($s) | returns an associative array of the declared properties of the class $s. The properties are visible from the current scope. |
| get_class_ methods($m) | returns an array of the names of the methods in the class $m. $m is the class name or an object instance. |
<!DOCTYPE html><html><head></head>
<body><?php
class P {
function shout(){
echo get_called_class()."<br />";
}
}
class C extends P{
const x=10;
private $a=1;
public $b=2;
static public $c=3;
}
class_alias('C','D');
$o = new D;
$o->shout();
$arr = get_object_vars($o); print_r($arr); echo "<br />";
$arr = get_class_vars('D'); print_r($arr); echo "<br />";
$arr = get_class_methods('D'); print_r($arr); echo "<br />";
$arr = get_class_methods($o); print_r($arr); echo "<br />";
?></body></html>C
Array ( [b] => 2 )
Array ( [b] => 2 [c] => 3 )
Array ( [0] => shout )
Array ( [0] => shout )