mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Remove PHP 4 only note (bug #49147)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@290810 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
8e286eb3f0
commit
e8db6b20fd
1 changed files with 2 additions and 24 deletions
|
@ -91,13 +91,12 @@ var_dump(property_exists($c, 'd')); // bool(true)
|
|||
</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 @@ $foo =& find_var($bar);
|
|||
using <literal>=&</literal> in this context is deprecated and
|
||||
produces an <constant>E_STRICT</constant> message.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Not using the <literal>&</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>&</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>&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>
|
||||
|
|
Loading…
Reference in a new issue