PHP3 -> PHP 3, PHP4 -> PHP 4

And everyone should follow that.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@32721 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Andrei Zmievski 2000-09-15 16:09:44 +00:00
parent aabc3c5c05
commit 13b81a2720
27 changed files with 71 additions and 71 deletions

View file

@ -44,8 +44,8 @@
</para>
<note>
<para>
The code for the debugger has not been ported to PHP4, at the
present time only PHP3 supports the debugger code.
The code for the debugger has not been ported to PHP 4, at the
present time only PHP 3 supports the debugger code.
</para>
</note>
</sect1>

View file

@ -4,7 +4,7 @@
<simpara></simpara>
<sect1 id="phpdevel-addfunc">
<title>Adding functions to PHP3</title>
<title>Adding functions to PHP 3</title>
<sect2 id="phpdevel-addfunc-prototype">
<title>Function Prototype</title>
<para>
@ -182,7 +182,7 @@ convert_string_to_number(arg1); /* Converts string to either LONG or DOUBLE dep
fault. So please take care and free all of your wasted memory.</simpara>
<simpara>
If you compile with "-DDEBUG", PHP3 will print out a list of all
If you compile with "-DDEBUG", PHP 3 will print out a list of all
memory that was allocated using emalloc() and estrdup() but never
freed with efree() when it is done running the specified script.</simpara></sect2>
@ -618,7 +618,7 @@ php3_list_delete(resource_id-&gt;value.lval);
<sect2 id="phpdevel-addfunc-addcfg">
<title>Adding runtime configuration directives</title>
<para>
Many of the features of PHP3 can be configured at runtime. These
Many of the features of PHP 3 can be configured at runtime. These
configuration directives can appear in either the designated
php3.ini file, or in the case of the Apache module version in the
Apache .conf files. The advantage of having them in the Apache

View file

@ -129,11 +129,11 @@
people had contributed to, to being a much more organized team
effort. The parser was rewritten from scratch by Zeev Suraski and
Andi Gutmans and this new parser formed the basis for PHP Version
3. A lot of the utility code from PHP/FI was ported over to PHP3
3. A lot of the utility code from PHP/FI was ported over to PHP 3
and a lot of it was completely rewritten.
</simpara>
<simpara>
Today (end-1999) either PHP/FI or PHP3 ships with a number of
Today (end-1999) either PHP/FI or PHP 3 ships with a number of
commercial products such as C2's StrongHold web server and RedHat
Linux. A conservative estimate based on an extrapolation from
numbers provided by <ulink url="&url.netcraft;">NetCraft</ulink>

View file

@ -216,7 +216,7 @@ if (is_uploaded_file($userfile)) {
<title>Common Pitfalls</title>
<simpara>
The MAX_FILE_SIZE item cannot specify a file size greater than the file
size that has been set in the upload_max_filesize in the PHP3.ini file
size that has been set in the upload_max_filesize in the PHP 3.ini file
or the corresponding php3_upload_max_filesize Apache .conf directive.
The default is 2 Megabytes.
</simpara>

View file

@ -251,11 +251,11 @@ array_keys ($array, "blue"); // returns array (0, 3, 4)
</para>
<note>
<para>
This function was added to PHP4, below is an implementation for
those still using PHP3.
This function was added to PHP 4, below is an implementation for
those still using PHP 3.
<example>
<title>
Implementation of <function>array_keys</function> for PHP3
Implementation of <function>array_keys</function> for PHP 3
users
</title>
<programlisting role="php">
@ -1029,11 +1029,11 @@ array_values ($array); // returns array ("XL", "gold")
</para>
<note>
<para>
This function was added to PHP4, below is an implementation for
those still using PHP3.
This function was added to PHP 4, below is an implementation for
those still using PHP 3.
<example>
<title>
Implementation of <function>array_values</function> for PHP3
Implementation of <function>array_values</function> for PHP 3
users
</title>
<programlisting role="php">

View file

@ -5,7 +5,7 @@
<partintro>
<simpara>
These functions are only available on the Windows version of
PHP. These functions have been added in PHP4.
PHP. These functions have been added in PHP 4.
</simpara>
</partintro>

View file

@ -39,7 +39,7 @@
</simpara>
<note>
<simpara>
The function <function>cpdf_set_font</function> has changed since PHP3
The function <function>cpdf_set_font</function> has changed since PHP 3
to support asian fonts. The encoding parameter is no longer an integer
but a string.
</simpara>

View file

@ -7,7 +7,7 @@
These functions are only available if the interpreter has been
compiled with the <option
role="configure">--with-cybercash=[DIR]</option>. These functions
have been added in PHP4.
have been added in PHP 4.
</simpara>
</partintro>

View file

@ -7,7 +7,7 @@
These functions are only available if PHP was configured with
<option role="configure">--with-dom=[DIR]</option>, using the
GNOME xml library. You will need at least libxml-2.0.0 (the beta
version will not work). These functions have been added in PHP4.
version will not work). These functions have been added in PHP 4.
</simpara>
<simpara>
This module defines the following constants:

View file

@ -255,7 +255,7 @@ error_reporting (E_ERROR | E_WARNING | E_PARSE | E_NOTICE); // New syntax for PH
/* good for code authoring to report uninitialized or (possibly mis-spelled) variables */
error_reporting (63); // Old syntax, PHP 2/3
error_reporting (E_ALL); // New syntax for PHP3/4
error_reporting (E_ALL); // New syntax for PHP 3/4
/* report all PHP errors */
</programlisting>
</example>
@ -328,7 +328,7 @@ error_reporting (E_ALL); // New syntax for PHP3/4
<programlisting role="php">
&lt;?php
// redefine the user error constants - PHP4 only
// redefine the user error constants - PHP 4 only
define (FATAL,E_USER_ERROR);
define (ERROR,E_USER_WARNING);
define (WARNING,E_USER_NOTICE);

View file

@ -158,7 +158,7 @@ similar(a,b) = 11(45.833333333333%)
<programlisting role="php">
$av = array("the ","a ","that ","this ");
array_walk($av, create_function('&$v,$k','$v = $v."mango";'));
print_r($av); // for PHP3 use var_dump()
print_r($av); // for PHP 3 use var_dump()
// outputs:
// Array
// (

View file

@ -177,10 +177,10 @@ header ("Pragma: no-cache"); // HTTP/1.0
</itemizedlist>
</para>
<simpara>
In PHP3, multiple calls to <function>setcookie</function> in the same
In PHP 3, multiple calls to <function>setcookie</function> in the same
script will be performed in reverse order. If you are trying to
delete one cookie before inserting another you should put the
insert before the delete. In PHP4, multiple calls to
insert before the delete. In PHP 4, multiple calls to
<function>setcookie</function> are performed in the order called.
</simpara>
<para>

View file

@ -514,7 +514,7 @@ magic_quotes_sybase = On
<note>
<para>
<function>Ibase_num_fields</function> is currently not functional
in PHP4.
in PHP 4.
</para>
</note>
</refsect1>

View file

@ -2168,7 +2168,7 @@ ExifVersion: 0200
<para>
<note>
<simpara>
This function is only available in PHP4 compiled using --enable-exif
This function is only available in PHP 4 compiled using --enable-exif
</simpara>
<simpara>
This function does not require the GD image library.

View file

@ -2708,7 +2708,7 @@ echo nl2br(imap_mail_compose($envelope,$body));
</funcprototype>
</funcsynopsis>
<para>
This function is currently only available in PHP3.
This function is currently only available in PHP 3.
</para>
</refsect1>
</refentry>

View file

@ -793,7 +793,7 @@ echo "Current PHP version: ".phpversion();
<para>
<note>
<para>
This funcionality was added in PHP4 Beta 4.
This funcionality was added in PHP 4 Beta 4.
</para>
</note>
</para>
@ -983,7 +983,7 @@ putenv ("UNIQID=$uniqid");
<para>
<note>
<para>
This funcionality was added in PHP4 Beta 4.
This funcionality was added in PHP 4 Beta 4.
</para>
</note>
</para>

View file

@ -116,7 +116,7 @@
</tgroup>
</table>
Only M_PI is available in PHP versions up to and including PHP4RC1.
All other constants are available starting with PHP4.0. Constants
All other constants are available starting with PHP 4.0. Constants
labelled [4.0.2] were added in PHP 4.0.2.
</para>
</sect2>

View file

@ -250,9 +250,9 @@ $file = fopen ($filename, 'r')
</simpara>
<simpara>
A <literal>return</literal> statement will terminate the evaluation of
the string immediatley. In PHP4 you may use <literal>return</literal>
the string immediatley. In PHP 4 you may use <literal>return</literal>
to return a value that will become the result of the
<function>eval</function> function while in PHP3
<function>eval</function> function while in PHP 3
<function>eval</function> was of type <literal>void</literal> and did
never return anything.
</simpara>

View file

@ -49,7 +49,7 @@
there has been tons of changes especially to the pdflib API. Most of
these changes has been somehow covered by PHP, some has even required
changes to the PHP API. Since pdflib
3.x the API seems to be stabilzed and PHP4 has adopted the version as a
3.x the API seems to be stabilzed and PHP 4 has adopted the version as a
minimum requirement for PDF support. The consequence will be that many
functions will disappear or be replaced by alternatives sooner or later.
Support for pdflib 0.6 is already completely given up.
@ -228,8 +228,8 @@
for possible changes.
</simpara>
<simpara>
Any version of PHP4 after March, 9th 2000 do not support versions
of pdflib older than 3.0. PHP3 on the other hand should not be used
Any version of PHP 4 after March, 9th 2000 do not support versions
of pdflib older than 3.0. PHP 3 on the other hand should not be used
with version newer than 2.01.
</simpara>
</sect1>

View file

@ -8,7 +8,7 @@
IEEE 1003.1 (POSIX.1) standards document which are not accessible
through other means. POSIX.1 for example defined the open(), read(),
write() and close() functions, too, which traditionally have been
part of PHP3 for a long time. Some more system specific functions
part of PHP 3 for a long time. Some more system specific functions
have not been available before, though, and this module tries to
remedy this by providing easy access to these functions.
</para>

View file

@ -64,7 +64,7 @@
<note>
<simpara>
This is an alias for <function>recode_string</function>. It has
been added in PHP4.
been added in PHP 4.
</simpara>
</note>
</refsect1>

View file

@ -76,7 +76,7 @@ swf_closefile ();
</para>
<note>
<para>
SWF support was added in PHP4 RC2.
SWF support was added in PHP 4 RC2.
</para>
</note>
</partintro>

View file

@ -422,9 +422,9 @@ for (expr1; expr2; expr3): statement; ...; endfor;
</para>
<para>
Other languages have a <literal>foreach</literal> statement to
traverse an array or hash. PHP3 has no such construct; PHP4 does
traverse an array or hash. PHP 3 has no such construct; PHP 4 does
(see <link
linkend="control-structures.foreach">foreach</link>). In PHP3, you
linkend="control-structures.foreach">foreach</link>). In PHP 3, you
can combine <link linkend="control-structures.while">while</link>
with the <function>list</function> and <function>each</function>
functions to achieve the same effect. See the documentation for
@ -435,7 +435,7 @@ for (expr1; expr2; expr3): statement; ...; endfor;
<sect1 id="control-structures.foreach">
<title><literal>foreach</literal></title>
<para>
PHP4 (not PHP3) includes a <literal>foreach</literal> construct,
PHP 4 (not PHP 3) includes a <literal>foreach</literal> construct,
much like perl and some other languages. This simply gives an easy
way to iterate over arrays. There are two syntaxes; the second is
a minor but useful extension of the first:
@ -887,11 +887,11 @@ require ("file.php"); /* Works. */
</informalexample>
</para>
<simpara>
In PHP3, it is possible to execute a <literal>return</literal>
In PHP 3, it is possible to execute a <literal>return</literal>
statement inside a <function>require</function>ed file, as long as
that statement occurs in the global scope of the
<function>require</function>ed file. It may not occur within any
block (meaning inside braces ({}). In PHP4, however, this ability
block (meaning inside braces ({}). In PHP 4, however, this ability
has been discontinued. If you need this functionality, see
<function>include</function>.
</simpara>
@ -974,22 +974,22 @@ if ($condition) {
</informalexample>
</para>
<simpara>
In both PHP3 and PHP4, it is possible to execute a
In both PHP 3 and PHP 4, it is possible to execute a
<literal>return</literal> statement inside an
<function>include</function>ed file, in order to terminate
processing in that file and return to the script which called
it. Some differences in the way this works exist, however. The
first is that in PHP3, the <literal>return</literal> may not
first is that in PHP 3, the <literal>return</literal> may not
appear inside a block unless it's a function block, in which case
the <literal>return</literal> applies to that function and not the
whole file. In PHP4, however, this restriction does not
exist. Also, PHP4 allows you to return values from
whole file. In PHP 4, however, this restriction does not
exist. Also, PHP 4 allows you to return values from
<function>include</function>ed files. You can take the value of
the <function>include</function> call as you would a normal
function. This generates a parse error in PHP3.
function. This generates a parse error in PHP 3.
</simpara>
<example>
<title><function>include</function> in PHP3 and PHP4</title>
<title><function>include</function> in PHP 3 and PHP 4</title>
<para>
Assume the existence of the following file (named
<filename>test.inc</filename>) in the same directory as the main
@ -1015,9 +1015,9 @@ echo "File returned: '$retval'&lt;br&gt;\n";
</programlisting>
</para>
<para>
When <filename>main.html</filename> is called in PHP3, it will
When <filename>main.html</filename> is called in PHP 3, it will
generate a parse error on line 2; you can't take the value of an
<function>include</function> in PHP3. In PHP4, however, the
<function>include</function> in PHP 3. In PHP 4, however, the
result will be:
<screen>
Before the return
@ -1035,12 +1035,12 @@ echo "Back in main.html&lt;br&gt;\n";
</programlisting>
</para>
<para>
In PHP4, the output will be:
In PHP 4, the output will be:
<screen>
Before the return
Back in main.html
</screen>
However, PHP3 will give the following output:
However, PHP 3 will give the following output:
<screen>
Before the return
27Back in main.html
@ -1059,7 +1059,7 @@ Before the return
</screen>
</para>
<para>
The spurious '27' is due to the fact that PHP3 does not support
The spurious '27' is due to the fact that PHP 3 does not support
<literal>return</literal>ing values from files like that.
</para>
</example>

View file

@ -23,18 +23,18 @@ function foo ($arg_1, $arg_2, ..., $arg_n) {
definitions.
</simpara>
<simpara>
In PHP3, functions must be defined before they are referenced. No
such requirement exists in PHP4.
In PHP 3, functions must be defined before they are referenced. No
such requirement exists in PHP 4.
</simpara>
<simpara>
PHP does not support function overloading, nor is it possible to
undefine or redefine previously-declared functions.
</simpara>
<simpara>
PHP3 does not support variable numbers of arguments to functions,
PHP 3 does not support variable numbers of arguments to functions,
although default arguments are supported (see <link
linkend="functions.arguments.default">Default argument
values</link> for more information). PHP4 supports both: see <link
values</link> for more information). PHP 4 supports both: see <link
linkend="functions.variable-arg-list">Variable-length argument
lists</link> and the function references for
<function>func_num_args</function>,
@ -57,13 +57,13 @@ function foo ($arg_1, $arg_2, ..., $arg_n) {
reference</link>, and <link
linkend="functions.arguments.default">default argument
values</link>. Variable-length argument lists are supported only
in PHP4 and later; see <link
in PHP 4 and later; see <link
linkend="functions.variable-arg-list">Variable-length argument
lists</link> and the function references for
<function>func_num_args</function>,
<function>func_get_arg</function>, and
<function>func_get_args</function> for more information. A
similar effect can be achieved in PHP3 by passing an array of
similar effect can be achieved in PHP 3 by passing an array of
arguments to a function:
<informalexample>
@ -208,7 +208,7 @@ Making a bowl of acidophilus raspberry.
<title>Variable-length argument lists</title>
<simpara>
PHP4 has support for variable-length argument lists in
PHP 4 has support for variable-length argument lists in
user-defined functions. This is really quite easy, using the
<function>func_num_args</function>,
<function>func_get_arg</function>, and
@ -282,7 +282,7 @@ $newref = &amp;returns_reference();
</simpara>
<simpara>
This is a deprecated feature, and should only be used by the
PHP/FI2->PHP3 convertor.
PHP/FI2->PHP 3 convertor.
</simpara>
<warning>
<para>
@ -292,7 +292,7 @@ $newref = &amp;returns_reference();
<function>usort</function>, <function>array_walk</function>, and
<function>register_shutdown_function</function>. You can get
around this limitation by writing a wrapper function (in normal
PHP3 form) to call the <literal>old_function</literal>.
PHP 3 form) to call the <literal>old_function</literal>.
</para>
</warning>

View file

@ -95,10 +95,10 @@ $b .= "There!"; // sets $b to "Hello There!", just like $b = $b . "There!";
Note that the assignment copies the original variable to the new
one (assignment by value), so changes to one will not affect the
other. This may also have relevance if you need to copy something
like a large array inside a tight loop. PHP4 supports assignment
like a large array inside a tight loop. PHP 4 supports assignment
by reference, using the <computeroutput>$var =
&amp;$othervar;</computeroutput> syntax, but this is not possible
in PHP3. 'Assignment by reference' means that both variables end
in PHP 3. 'Assignment by reference' means that both variables end
up pointing at the same data, and nothing is copied anywhere.
To learn more about references, please read <link
linkend="language.references">References explained</link>.
@ -194,7 +194,7 @@ $b .= "There!"; // sets $b to "Hello There!", just like $b = $b . "There!";
<entry>Identical</entry>
<entry>
True if $a is equal to $b, and they are of the same
type. (PHP4 only)
type. (PHP 4 only)
</entry>
</row>
<row>
@ -207,7 +207,7 @@ $b .= "There!"; // sets $b to "Hello There!", just like $b = $b . "There!";
<entry>Not identical</entry>
<entry>
True if $a is not equal to $b, or they are not of the same
type. (PHP4 only)
type. (PHP 4 only)
</entry>
</row>
<row>

View file

@ -419,7 +419,7 @@ $a["foo"][4]["bar"][0] = $f; # four dimensional!
</informalexample>
</para>
<para>
In PHP3 it is not possible to reference multidimensional arrays
In PHP 3 it is not possible to reference multidimensional arrays
directly within strings. For instance, the following will not
have the desired result:
<informalexample>
@ -428,7 +428,7 @@ $a[3]['bar'] = 'Bob';
echo "This won't work: $a[3][bar]";
</programlisting>
</informalexample>
In PHP3, the above will output <computeroutput>This won't work:
In PHP 3, the above will output <computeroutput>This won't work:
Array[bar]</computeroutput>. The string concatenation operator,
however, can be used to overcome this:
<informalexample>
@ -439,7 +439,7 @@ echo "This will work: " . $a[3][bar];
</informalexample>
</para>
<para>
In PHP4, however, the whole problem may be circumvented by
In PHP 4, however, the whole problem may be circumvented by
enclosing the array reference (inside the string) in curly
braces:
<informalexample>

View file

@ -39,7 +39,7 @@ $t
</para>
<para>
In PHP3, variables are always assigned by value. That is to say,
In PHP 3, variables are always assigned by value. That is to say,
when you assign an expression to a variable, the entire value of
the original expression is copied into the destination
variable. This means, for instance, that after assigning one
@ -49,7 +49,7 @@ $t
linkend="language.expressions">Expressions</link>.
</para>
<para>
PHP4 offers another way to assign values to variables:
PHP 4 offers another way to assign values to variables:
<emphasis>assign by reference</emphasis>. This means that the new
variable simply references (in other words, "becomes an alias for"
or "points to") the original variable. Changes to the new variable