We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 18bac83 commit eb55709Copy full SHA for eb55709
reference/reflection/reflectionclass/isinstance.xml
@@ -48,20 +48,24 @@
48
<programlisting role="php">
49
<![CDATA[
50
<?php
51
-// Example usage
52
-$class = new ReflectionClass('Foo');
53
54
-if ($class->isInstance($arg)) {
55
- echo "Yes";
+class Foo {}
+
+$object = new Foo();
56
+$reflection = new ReflectionClass('Foo');
57
58
+if ($reflection->isInstance($object)) {
59
+ echo "Yes\n";
60
}
61
62
// Equivalent to
-if ($arg instanceof Foo) {
63
+if ($object instanceof Foo) {
64
65
66
67
-if (is_a($arg, 'Foo')) {
68
+if (is_a($object, 'Foo')) {
69
echo "Yes";
70
71
?>
0 commit comments