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

From: Date: Sun, 15 Aug 2010 07:39:53 +0000
Subject: svn: /phpdoc/en/trunk/language/oop5/ basic.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-6995@lists.php.net to get a copy of this message
degeberg Sun, 15 Aug 2010 07:39:53 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=302259 Log: Fixed PHP bug #52494 (description of keyword "new") Bug: http://bugs.php.net/52494 (Open) description of keyword "new" 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 2010-08-15 07:35:45 UTC (rev 302258) +++ phpdoc/en/trunk/language/oop5/basic.xml 2010-08-15 07:39:53 UTC (rev 302259) @@ -111,14 +111,19 @@ <sect2 xml:id="language.oop5.basic.new"> <title>new</title> <para> - To create an instance of a class, a new object must be created and - assigned to a variable. An object will always be assigned when - creating a new object unless the object has a + To create an instance of a class, the <literal>new</literal> keyword must + be used. An object will always be created when unless the object has a <link linkend="language.oop5.decon">constructor</link> defined that throws an <link linkend="language.exceptions">exception</link> on error. Classes should be defined before instantiation (and in some cases this is a requirement). </para> + <para> + If a <type>string</type> containing the name of a class is used with + <literal>new</literal>, a new instance of that class will be created. If + the class is in a namespace, its fully qualified name must be used when + doing this. + </para> <example> <title>Creating an instance</title> <programlisting role="php">

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