svn: /phpdoc/en/trunk/language/oop5/ basic.xml

From: Date: Mon, 24 Aug 2009 07:11:03 +0000
Subject: svn: /phpdoc/en/trunk/language/oop5/ basic.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-4747@lists.php.net to get a copy of this message
torben Mon, 24 Aug 2009 07:11:03 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=287632 Log: Fixes to grammar and clarification of what a valid class name is. Changed paths: U phpdoc/en/trunk/language/oop5/basic.xml Modified: phpdoc/en/trunk/language/oop5/basic.xml =================================================================== --- phpdoc/en/trunk/language/oop5/basic.xml 2009-08-24 06:50:56 UTC (rev 287631) +++ phpdoc/en/trunk/language/oop5/basic.xml 2009-08-24 07:11:03 UTC (rev 287632) @@ -7,16 +7,30 @@ <sect2 xml:id="language.oop5.basic.class"> <title>class</title> <para> - Every class definition begins with the keyword class, followed by a class - name, which can be any name that isn't a <link linkend="reserved">reserved</link> - word in PHP. Followed by a pair of curly braces, - which contains the definition of the classes members and methods. A - pseudo-variable, <varname>$this</varname> is available when a method is - called from within an object context. <varname>$this</varname> is a - reference to the calling object (usually the object to which the method - belongs, but can be another object, if the method is called + Every class definition begins with the + keyword <literal>class</literal>, followed by a class name, + followed by a pair of curly braces which enclose the definition of + the class's members and methods. The + pseudo-variable <varname>$this</varname> is available when a + method is called from within an object + context. <varname>$this</varname> is a reference to the calling + object (usually the object to which the method belongs, but + possibly another object, if the method is called <link linkend="language.oop5.static">statically</link> from the context - of a secondary object). This is illustrated in the following examples: + of a secondary object). + </para> + <para> + The class name can be any name which is a not a + PHP <link linkend="reserved">reserved word</link> and which is a + valid label--that is, it must conform to + the <link linkend="language.variables.basics">PHP rules for + variable naming</link> except that the class name has no preceding + dollar sign. + </para> + <para> + Here are some basic examples of class definition, object + construction, and use of the <varname>$this</varname> + pseudo-variable: <example> <title><varname>$this</varname> variable in object-oriented language</title> <programlisting role="php">

« previous php.doc.cvs (#4747) next »