Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

cvs: phpdoc /en/language/oop5 final.xml
helly		Wed Sep 29 15:53:43 2004 EDT

Modified files:
/phpdoc/en/language/oop5	final.xml
Log:
- Include final classes

[url]http://cvs.php.net/diff.php/phpdoc/en/language/oop5/final.xml?r1=1.4&r2=1.5&ty=u[/
url]
Index: phpdoc/en/language/oop5/final.xml
diff -u phpdoc/en/language/oop5/final.xml:1.4 phpdoc/en/language/oop5/final.
xml:1.5
--- phpdoc/en/language/oop5/final.xml:1.4	Mon Sep 27 10:38:44 2004
+++ phpdoc/en/language/oop5/final.xml	Wed Sep 29 15:53:43 2004
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<sect1 id="language.oop5.final">
<title>Final Keyword</title>
<para>
PHP 5 introduces the final keyword, which prevents child classes from
-   overriding a method by prefixing the definition with final.
+   overriding a method by prefixing the definition with final. If the class
+   itself is being defined final then it cannot be extended.
</para>

<example>
@@ -33,6 +34,29 @@
</programlisting>
</example>

+  <example>
+   <title>Final class example</title>
+    <programlisting role="php">
+<![CDATA[
+<?php
+final class BaseClass {
+   public function test() {
+       echo "BaseClass::test() called\n";
+   }
+
+   // Here it doesn't matter if you specify the function as final or not
+   final public function moreTesting() {
+       echo "BaseClass::moreTesting() called\n";
+   }
+}
+
+class ChildClass extends BaseClass {
+}
+// Results in Fatal error: Class ChildClass may not inherit from final clas
s (BaseClass)
+?>
+]]>
+   </programlisting>
+  </example>
</sect1>

<!-- Keep this comment at the end of the file

Report this thread to moderator Post Follow-up to this message
Old Post
Marcus Boerger
09-30-04 01:04 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Documentation archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:42 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.