mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
Documented constructor changes in PHP 5.3.3.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@301474 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
587df982a2
commit
8574a2c1bd
2 changed files with 31 additions and 0 deletions
|
@ -16,6 +16,16 @@
|
|||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>5.3.3</entry>
|
||||
<entry>
|
||||
Changed: Methods with the same name as the last element of
|
||||
a <link linkend="language.namespaces">namespaced</link>
|
||||
class name will no longer be treated as <link
|
||||
linkend="language.oop5.decon">constructor</link>. This change doesn't
|
||||
affect non-namespaced classes.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>5.3.0</entry>
|
||||
<entry>
|
||||
|
|
|
@ -62,6 +62,27 @@ $obj = new SubClass();
|
|||
<function>__construct</function> is overridden with different parameters
|
||||
than the parent <function>__construct</function> method has.
|
||||
</para>
|
||||
<para>
|
||||
As of PHP 5.3.3, methods with the same name as the last element of a
|
||||
namespaced class name will no longer be treated as constructor. This
|
||||
change doesn't affect non-namespaced classes.
|
||||
</para>
|
||||
<example>
|
||||
<title>Constructors in namespaced classes</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
namespace Foo;
|
||||
class Bar {
|
||||
public function Bar() {
|
||||
// treated as constructor in PHP 5.3.0-5.3.2
|
||||
// treated as regular method as of PHP 5.3.3
|
||||
}
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="language.oop5.decon.destructor">
|
||||
|
|
Loading…
Reference in a new issue