File tree Expand file tree Collapse file tree
reference/reflection/reflectionproperty Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,13 +67,13 @@ $rClass = new \ReflectionClass(Example::class);
6767$rProp = $rClass->getProperty('tag');
6868
6969// 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";
7474
7575// But this would bypass the hook and produce "PHP".
76- print $rProp->getRawValue($example);
76+ echo $rProp->getRawValue($example);
7777?>
7878]]>
7979 </programlisting >
Original file line number Diff line number Diff line change @@ -82,17 +82,17 @@ $rProp = $rClass->getProperty('age');
8282try {
8383 $example->age = -2;
8484} catch (InvalidArgumentException) {
85- print "InvalidArgumentException for setting property to -2\n";
85+ echo "InvalidArgumentException for setting property to -2\n";
8686}
8787try {
8888 $rProp->setValue($example, -2);
8989} catch (InvalidArgumentException) {
90- print "InvalidArgumentException for using ReflectionProperty::setValue() with -2\n";
90+ echo "InvalidArgumentException for using ReflectionProperty::setValue() with -2\n";
9191}
9292
9393// But this would set the $age to -2 without error.
9494$rProp->setRawValue($example, -2);
95- print $example->age;
95+ echo $example->age;
9696?>
9797]]>
9898 </programlisting >
You can’t perform that action at this time.
0 commit comments