Add a note about only classes and methods may be declared final

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@278494 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Kalle Sommer Nielsen 2009-04-09 11:03:38 +00:00
parent 02f5774954
commit aa5ec5b80d

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- $Revision: 1.7 $ -->
<sect1 xml:id="language.oop5.final" xmlns="http://docbook.org/ns/docbook">
<title>Final Keyword</title>
<para>
@ -7,9 +7,9 @@
overriding a method by prefixing the definition with final. If the class
itself is being defined final then it cannot be extended.
</para>
<example>
<title>Final methods example</title>
<para>
<example>
<title>Final methods example</title>
<programlisting role="php">
<![CDATA[
<?php
@ -33,9 +33,10 @@ class ChildClass extends BaseClass {
]]>
</programlisting>
</example>
<example>
<title>Final class example</title>
</para>
<para>
<example>
<title>Final class example</title>
<programlisting role="php">
<![CDATA[
<?php
@ -55,8 +56,15 @@ class ChildClass extends BaseClass {
// Results in Fatal error: Class ChildClass may not inherit from final class (BaseClass)
?>
]]>
</programlisting>
</example>
</programlisting>
</example>
</para>
<note>
<simpara>
Properties cannot be declared final, only classes and methods
may be declared as final.
</simpara>
</note>
</sect1>
<!-- Keep this comment at the end of the file