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 static.xml
helly		Thu Sep 30 14:22:30 2004 EDT

Modified files:
/phpdoc/en/language/oop5	static.xml
Log:
- Upate

[url]http://cvs.php.net/diff.php/phpdoc/en/language/oop5/static.xml?r1=1.3&r2=1.4&ty=u[
/url]
Index: phpdoc/en/language/oop5/static.xml
diff -u phpdoc/en/language/oop5/static.xml:1.3 phpdoc/en/language/oop5/stati
c.xml:1.4
--- phpdoc/en/language/oop5/static.xml:1.3	Thu Aug 12 21:00:44 2004
+++ phpdoc/en/language/oop5/static.xml	Thu Sep 30 14:22:30 2004
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<sect1 id="language.oop5.static">
<title>Static Keyword</title>

@@ -23,6 +23,20 @@
the object created, the pseudo variable <varname>$this</varname> is
not available inside the method declared as static.
</para>
+
+  <para>
+   In fact <literal>static</literal> method calls are resolved at compile
+   time. When using an explicit class name the method is already identified
+   completley and no inheritance rules apply. If the call is done by
+   <literal>self</literal> then <literal>self</literal> is translated to
+   the current class, that is the class the code belongs to. Here also no
+   inheritance rules apply.
+  </para>
+
+  <para>
+   Static properties cannot be accessed through the object using the arrow
+   operator -&gt;.
+  </para>

<example>
<title>Static member example</title>
@@ -49,7 +63,9 @@

$foo = new Foo();
print $foo->staticValue() . "\n";
-print $foo->my_static . "\n";      // Undefined my_static
+print $foo->my_static . "\n";      // Undefined "Property" my_static
+
+// $foo::my_static   is not possible

print Bar::$my_static . "\n";
$bar = new Bar();

Report this thread to moderator Post Follow-up to this message
Old Post
Marcus Boerger
10-01-04 01:56 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.