File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
reference/reflection/reflectionproperty Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -67,13 +67,13 @@ $rClass = new \ReflectionClass(Example::class);
67
67
$rProp = $rClass->getProperty('tag');
68
68
69
69
// These would go through the get hook, so would produce "php".
70
- print $example->tag;
71
- print "\n";
72
- print $rProp->getValue($example);
73
- print "\n";
70
+ echo $example->tag;
71
+ echo "\n";
72
+ echo $rProp->getValue($example);
73
+ echo "\n";
74
74
75
75
// But this would bypass the hook and produce "PHP".
76
- print $rProp->getRawValue($example);
76
+ echo $rProp->getRawValue($example);
77
77
?>
78
78
]]>
79
79
</programlisting >
Original file line number Diff line number Diff line change @@ -82,17 +82,17 @@ $rProp = $rClass->getProperty('age');
82
82
try {
83
83
$example->age = -2;
84
84
} catch (InvalidArgumentException) {
85
- print "InvalidArgumentException for setting property to -2\n";
85
+ echo "InvalidArgumentException for setting property to -2\n";
86
86
}
87
87
try {
88
88
$rProp->setValue($example, -2);
89
89
} catch (InvalidArgumentException) {
90
- print "InvalidArgumentException for using ReflectionProperty::setValue() with -2\n";
90
+ echo "InvalidArgumentException for using ReflectionProperty::setValue() with -2\n";
91
91
}
92
92
93
93
// But this would set the $age to -2 without error.
94
94
$rProp->setRawValue($example, -2);
95
- print $example->age;
95
+ echo $example->age;
96
96
?>
97
97
]]>
98
98
</programlisting >
You can’t perform that action at this time.
0 commit comments