mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
add version info
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@312956 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
67ccd20607
commit
cb0630b149
16 changed files with 45 additions and 17 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
<sect1 xml:id="language.namespaces.rationale">
|
||||
<title>Namespaces overview</title>
|
||||
<?phpdoc print-version-for="namespaces"?>
|
||||
<simpara>
|
||||
What are namespaces? In the broadest definition namespaces are a way of encapsulating
|
||||
items. This can be seen as an abstract concept in many places. For example, in any
|
||||
|
@ -68,13 +69,11 @@ echo constant($d); // see "Namespaces and dynamic language features" section
|
|||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<simpara>
|
||||
Namespaces are available in PHP as of PHP 5.3.0.
|
||||
</simpara>
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="language.namespaces.definition">
|
||||
<title>Defining namespaces</title>
|
||||
<?phpdoc print-version-for="namespaces"?>
|
||||
<para>
|
||||
Although any valid PHP code can be contained within a namespace, only three
|
||||
type of code are affected by namespaces: classes, functions and constants.
|
||||
|
@ -121,6 +120,7 @@ namespace MyProject; // fatal error - namespace must be the first statement in t
|
|||
</sect1>
|
||||
<sect1 xml:id="language.namespaces.nested">
|
||||
<title>Declaring sub-namespaces</title>
|
||||
<?phpdoc print-version-for="namespaces"?>
|
||||
<para>
|
||||
Much like directories and files, PHP namespaces also contain the ability to specify
|
||||
a hierarchy of namespace names. Thus, a namespace name can be defined with
|
||||
|
@ -147,6 +147,7 @@ function connect() { /* ... */ }
|
|||
</sect1>
|
||||
<sect1 xml:id="language.namespaces.definitionmultiple">
|
||||
<title>Defining multiple namespaces in the same file</title>
|
||||
<?phpdoc print-version-for="namespaces"?>
|
||||
<para>
|
||||
Multiple namespaces may also be declared in the same file. There are two allowed
|
||||
syntaxes.
|
||||
|
@ -261,6 +262,7 @@ echo MyProject\Connection::start();
|
|||
</sect1>
|
||||
<sect1 xml:id="language.namespaces.basics">
|
||||
<title>Using namespaces: Basics</title>
|
||||
<?phpdoc print-version-for="namespaces"?>
|
||||
<para>
|
||||
Before discussing the use of namespaces, it is important to understand how PHP
|
||||
knows which namespaced element your code is requesting. A simple analogy can be made
|
||||
|
@ -406,6 +408,7 @@ $c = new \Exception('error'); // instantiates global class Exception
|
|||
</sect1>
|
||||
<sect1 xml:id="language.namespaces.dynamic">
|
||||
<title>Namespaces and dynamic language features</title>
|
||||
<?phpdoc print-version-for="namespaces"?>
|
||||
<para>
|
||||
PHP's implementation of namespaces is influenced by its dynamic nature as a programming
|
||||
language. Thus, to convert code like the following example into namespaced code:
|
||||
|
@ -491,6 +494,7 @@ echo constant('namespacename\constname'), "\n"; // also prints namespaced
|
|||
</sect1>
|
||||
<sect1 xml:id="language.namespaces.nsconstants">
|
||||
<title>namespace keyword and __NAMESPACE__ constant</title>
|
||||
<?phpdoc print-version-for="namespaces"?>
|
||||
<para>
|
||||
PHP supports two ways of abstractly accessing elements within the current namespace,
|
||||
the <constant>__NAMESPACE__</constant> magic constant, and the <literal>namespace</literal>
|
||||
|
@ -585,6 +589,7 @@ $b = namespace\CONSTANT; // assigns value of constant CONSTANT to $b
|
|||
</sect1>
|
||||
<sect1 xml:id="language.namespaces.importing">
|
||||
<title>Using namespaces: Aliasing/Importing</title>
|
||||
<?phpdoc print-version-for="namespaces"?>
|
||||
<para>
|
||||
The ability to refer to an external fully qualified name with an alias, or importing,
|
||||
is an important feature of namespaces. This is similar to the
|
||||
|
@ -721,6 +726,7 @@ class Greenlandic
|
|||
</sect1>
|
||||
<sect1 xml:id="language.namespaces.global">
|
||||
<title>Global space</title>
|
||||
<?phpdoc print-version-for="namespaces"?>
|
||||
<para>
|
||||
Without any namespace definition, all class and function definitions are
|
||||
placed into the global space - as it was in PHP before namespaces were
|
||||
|
@ -748,6 +754,7 @@ function fopen() {
|
|||
</sect1>
|
||||
<sect1 xml:id="language.namespaces.fallback">
|
||||
<title>Using namespaces: fallback to global function/constant</title>
|
||||
<?phpdoc print-version-for="namespaces"?>
|
||||
<para>
|
||||
Inside a namespace, when PHP encounters a unqualified Name in a class name, function or
|
||||
constant context, it resolves these with different priorities. Class names always
|
||||
|
@ -804,6 +811,7 @@ if (is_array('hi')) { // prints "is not array"
|
|||
|
||||
<sect1 xml:id="language.namespaces.rules">
|
||||
<title>Name resolution rules</title>
|
||||
<?phpdoc print-version-for="namespaces"?>
|
||||
<para>
|
||||
For the purposes of these resolution rules, here are some important definitions:
|
||||
<variablelist>
|
||||
|
@ -1004,6 +1012,7 @@ A\B::foo(); // calls method "foo" of class "B" from namespace "A\A"
|
|||
</sect1>
|
||||
<sect1 xml:id="language.namespaces.faq">
|
||||
<title>FAQ: things you need to know about namespaces</title>
|
||||
<?phpdoc print-version-for="namespaces"?>
|
||||
<para>
|
||||
This FAQ is split into two sections: common questions, and some specifics of
|
||||
implementation that are helpful to understand fully.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.argc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.argc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>$argc</refname>
|
||||
<refpurpose>The number of arguments passed to script</refpurpose>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.argv" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.argv" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>$argv</refname>
|
||||
<refpurpose>Array of arguments passed to script</refpurpose>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.cookies" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.cookies" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>$_COOKIE</refname>
|
||||
<refname>$HTTP_COOKIE_VARS [deprecated]</refname>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.environment" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.environment" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>$_ENV</refname>
|
||||
<refname>$HTTP_ENV_VARS [deprecated]</refname>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.files" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.files" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>$_FILES</refname>
|
||||
<refname>$HTTP_POST_FILES [deprecated]</refname>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.get" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.get" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>$_GET</refname>
|
||||
<refname>$HTTP_GET_VARS [deprecated]</refname>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.globals" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.globals" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>$GLOBALS</refname>
|
||||
<refpurpose>References all variables available in global scope</refpurpose>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.httprawpostdata" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.httprawpostdata" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>$HTTP_RAW_POST_DATA</refname>
|
||||
<refpurpose>Raw POST data</refpurpose>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.httpresponseheader" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.httpresponseheader" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>$http_response_header</refname>
|
||||
<refpurpose>HTTP response headers</refpurpose>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.phperrormsg" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.phperrormsg" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>$php_errormsg</refname>
|
||||
<refpurpose>The previous error message</refpurpose>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.post" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.post" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>$_POST</refname>
|
||||
<refname>$HTTP_POST_VARS [deprecated]</refname>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.request" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.request" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>$_REQUEST</refname>
|
||||
<refpurpose>HTTP Request variables</refpurpose>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.server" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.server" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>$_SERVER</refname>
|
||||
<refname>$HTTP_SERVER_VARS [deprecated]</refname>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.session" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" role="noversion">
|
||||
<phpdoc:varentry xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="reserved.variables.session" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>$_SESSION</refname>
|
||||
<refname>$HTTP_SESSION_VARS [deprecated]</refname>
|
||||
|
|
|
@ -34,6 +34,25 @@
|
|||
|
||||
<function name='serializable::serialize' from='PHP 5 >= 5.1.0'/>
|
||||
<function name='serializable::unserialize' from='PHP 5 >= 5.1.0'/>
|
||||
|
||||
|
||||
<function name='namespaces' from='PHP 5 >= 5.3.0'/>
|
||||
|
||||
<function name='_COOKIE' from='PHP 4 >= 4.1.0, PHP 5' />
|
||||
<function name='_ENV' from='PHP 4 >= 4.1.0, PHP 5' />
|
||||
<function name='_FILES' from='PHP 4 >= 4.1.0, PHP 5' />
|
||||
<function name='_GET' from='PHP 4 >= 4.1.0, PHP 5' />
|
||||
<function name='GLOBALS' from='PHP 4, PHP 5' />
|
||||
<function name='HTTP_RAW_POST_DATA' from='PHP 4, PHP 5' />
|
||||
<function name='http_response_header' from='PHP 4 >= 4.0.4, PHP 5' />
|
||||
<function name='php_errormsg' from='PHP 4, PHP 5' />
|
||||
<function name='_GET' from='PHP 4 >= 4.1.0, PHP 5' />
|
||||
<function name='_REQUEST' from='PHP 4 >= 4.1.0, PHP 5' />
|
||||
<function name='_SERVER' from='PHP 4 >= 4.1.0, PHP 5' />
|
||||
<function name='_SESSION' from='PHP 4 >= 4.1.0, PHP 5' />
|
||||
|
||||
<function name='argc' from='PHP 4, PHP 5' />
|
||||
<function name='argv' from='PHP 4, PHP 5' />
|
||||
</versions>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
Loading…
Reference in a new issue