svn: /phpdoc/en/trunk/language/ references.xml

From: Date: Mon, 16 Nov 2009 12:06:45 +0000
Subject: svn: /phpdoc/en/trunk/language/ references.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-5396@lists.php.net to get a copy of this message
vrana Mon, 16 Nov 2009 12:06:45 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=290810 Log: Remove PHP 4 only note (bug #49147) Bug: http://bugs.php.net/49147 (Closed) "What references do" docs are incorrect Changed paths: U phpdoc/en/trunk/language/references.xml Modified: phpdoc/en/trunk/language/references.xml =================================================================== --- phpdoc/en/trunk/language/references.xml 2009-11-16 11:56:47 UTC (rev 290809) +++ phpdoc/en/trunk/language/references.xml 2009-11-16 12:06:45 UTC (rev 290810) @@ -91,13 +91,12 @@ </note> <para> The same syntax can be used with functions that return - references, and with the <literal>new</literal> operator (in PHP - 4.0.4 and later): + references, and with the <literal>new</literal> operator (since PHP + 4.0.4 and before PHP 5.0.0): <informalexample> <programlisting role="php"> <![CDATA[ <?php -$bar =& new fooclass(); $foo =& find_var($bar); ?> ]]> @@ -108,27 +107,6 @@ using <literal>=&amp;</literal> in this context is deprecated and produces an <constant>E_STRICT</constant> message. </para> - <note> - <para> - Not using the <literal>&amp;</literal> operator causes a copy of - the object to be made. If you use <literal>$this</literal> in - the class it will operate on the current instance of the - class. The assignment without - <literal>&amp;</literal> will copy the instance (i.e. the object) and - <literal>$this</literal> will operate on the copy, which is not - always what is desired. Usually you want to have a single - instance to work with, due to performance and memory consumption - issues. - </para> - <para> - While you can use the <literal>@</literal> operator to - <emphasis>mute</emphasis> any errors in the constructor when - using it as - <literal>@new</literal>, this does not work when using the - <literal>&amp;new</literal> statement. This is a limitation of the Zend - Engine and will therefore result in a parse error. - </para> - </note> <warning> <para> If you assign a reference to a variable declared <literal>global</literal>

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