reference/reflection/reflectionclass/isinstantiable.xml
ec2fe9a592f794978114ef5021db9f1d00c2e05d
...
...
@@ -1,6 +1,5 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<refentry xml:id="reflectionclass.isinstantiable" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
4
<refnamediv>
6
5
<refname>ReflectionClass::isInstantiable</refname>
...
...
@@ -9,9 +8,9 @@
9
8

10
9
<refsect1 role="description">
11
10
&reftitle.description;
12
-
<methodsynopsis>
11
+
<methodsynopsis role="ReflectionClass">
13
12
<modifier>public</modifier> <type>bool</type><methodname>ReflectionClass::isInstantiable</methodname>
14
-
<void />
13
+
<void/>
15
14
</methodsynopsis>
16
15
<para>
17
16
Checks if the class is instantiable.
...
...
@@ -58,6 +57,10 @@ class D extends abstractClass {
58
57
function f2() { }
59
58
}
60
59

60
+
trait T {
61
+
function f1() {}
62
+
}
63
+

61
64
class privateConstructor {
62
65
private function __construct() { }
63
66
}
...
...
@@ -68,13 +71,14 @@ $classes = array(
68
71
"ifaceImpl",
69
72
"abstractClass",
70
73
"D",
74
+
"T",
71
75
"privateConstructor",
72
76
);
73
77

74
78
foreach($classes as $class ) {
75
79
$reflectionClass = new ReflectionClass($class);
76
80
echo "Is $class instantiable? ";
77
-
var_dump($reflectionClass->IsInstantiable());
81
+
var_dump($reflectionClass->isInstantiable());
78
82
}
79
83

80
84
?>
...
...
@@ -88,6 +92,7 @@ Is iface instantiable? bool(false)
88
92
Is ifaceImpl instantiable? bool(true)
89
93
Is abstractClass instantiable? bool(false)
90
94
Is D instantiable? bool(true)
95
+
Is T instantiable? bool(false)
91
96
Is privateConstructor instantiable? bool(false)
92
97
]]>
93
98
</screen>
...
...
@@ -106,7 +111,6 @@ Is privateConstructor instantiable? bool(false)
106
111
</refsect1>
107
112

108
113
</refentry>
109
-

110
114
<!-- Keep this comment at the end of the file
111
115
Local variables:
112
116
mode: sgml
113
117