Remove E_STRICT and other PHP 5 related information (#730)

This commit is contained in:
Kamil Tekiela 2021-08-17 17:56:25 +01:00 committed by GitHub
parent 1499a2369c
commit de9c65c91f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 18 additions and 61 deletions

View file

@ -1173,11 +1173,8 @@ It is strongly recommended to avoid timezone abbreviations.
</simpara>'>
<!ENTITY date.timezone.errors.description '<para xmlns="http://docbook.org/ns/docbook">
Every call to a date/time function will generate a <constant>E_NOTICE</constant>
if the time zone is not valid, and/or a <constant>E_STRICT</constant>
or <constant>E_WARNING</constant> message
if using the system settings or the <varname>TZ</varname> environment
variable. See also <function>date_default_timezone_set</function></para>'>
Every call to a date/time function will generate a <constant>E_WARNING</constant>
if the time zone is not valid. See also <function>date_default_timezone_set</function></para>'>
<!ENTITY date.timezone.errors.changelog '<row xmlns="http://docbook.org/ns/docbook"><entry>5.1.0</entry><entry><para>
Now issues the <constant>E_STRICT</constant> and <constant>E_NOTICE</constant>
@ -1233,7 +1230,9 @@ is inserted with (e.g.) <function xmlns="http://docbook.org/ns/docbook">domnode_
<!ENTITY dom.node.inserted 'This node will not show up in the document unless
it is inserted with (e.g.) <function xmlns="http://docbook.org/ns/docbook">DOMNode::appendChild</function>.'>
<!ENTITY dom.allowstatic '<para xmlns="http://docbook.org/ns/docbook">This method <emphasis>may</emphasis> be called statically, but will issue an <constant>E_STRICT</constant> error.</para>'>
<!ENTITY dom.allowstatic '<para xmlns="http://docbook.org/ns/docbook">Prior to PHP 8.0.0 this method
<emphasis>could</emphasis> be called statically, but would issue an <constant>E_DEPRECATED</constant> error.
As of PHP 8.0.0 calling this method statically throws an <classname>Error</classname> exception</para>'>
<!ENTITY dom.malformederror '<para xmlns="http://docbook.org/ns/docbook">While malformed HTML should load successfully, this function may generate <constant>E_WARNING</constant> errors when it encounters bad markup. <link linkend="function.libxml-use-internal-errors">libxml&apos;s error handling functions</link> may be used to handle these errors.</para>'>
<!ENTITY dom.note.utf8 '<note xmlns="http://docbook.org/ns/docbook"><para>The DOM extension uses UTF-8 encoding. Use <function>utf8_encode</function> and <function>utf8_decode</function> to work with texts in ISO-8859-1 encoding or <link linkend="ref.iconv">iconv</link> for other encodings.</para></note>'>
<!ENTITY dom.note.json '<note xmlns="http://docbook.org/ns/docbook"><para>When using <function>json_encode</function> on a <classname>DOMDocument</classname> object the result will be that of encoding an empty object.</para></note>'>

View file

@ -37,7 +37,7 @@
to <constant>E_ALL</constant>, as you need to be aware of and fix the
issues raised by PHP. In production, you may wish to set this to a less
verbose level such as
<code>E_ALL &amp; ~E_NOTICE &amp; ~E_STRICT &amp; ~E_DEPRECATED</code>, but
<code>E_ALL &amp; ~E_NOTICE &amp; ~E_DEPRECATED</code>, but
in many cases <constant>E_ALL</constant> is also appropriate, as it may
provide early warning of potential issues.
</para>

View file

@ -81,7 +81,7 @@ echo $doc->saveXML();
<programlisting role="php">
<![CDATA[
<?php
// Issues an E_STRICT error
// Issues an E_DEPRECATED error
$doc = DOMDocument::loadXML('<root><node/></root>');
echo $doc->saveXML();
?>

View file

@ -183,7 +183,7 @@
to your code which will ensure the best interoperability
and forward compatibility of your code.
</entry>
<entry>Not included in <constant>E_ALL</constant> prior to PHP 5.4.0</entry>
<entry></entry>
</row>
<row xml:id="errorfunc.constants.errorlevels.e-recoverable-error">
@ -199,7 +199,7 @@
<function>set_error_handler</function>), the application aborts as it
was an <constant>E_ERROR</constant>.
</entry>
<entry>As of PHP 5.2.0</entry>
<entry></entry>
</row>
<row xml:id="errorfunc.constants.errorlevels.e-deprecated-error">
@ -212,7 +212,7 @@
Run-time notices. Enable this to receive warnings about code
that will not work in future versions.
</entry>
<entry>As of PHP 5.3.0</entry>
<entry></entry>
</row>
<row xml:id="errorfunc.constants.errorlevels.e-user-deprecated">
@ -226,7 +226,7 @@
<constant>E_DEPRECATED</constant>, except it is generated in PHP code by
using the PHP function <function>trigger_error</function>.
</entry>
<entry>As of PHP 5.3.0</entry>
<entry></entry>
</row>
<row xml:id="errorfunc.constants.errorlevels.e-all">
@ -236,15 +236,9 @@
(<type>int</type>)
</entry>
<entry>
All errors and warnings, as supported, except of level
<constant>E_STRICT</constant> prior to PHP 5.4.0.
</entry>
<entry>
32767 in PHP 5.4.x,
30719 in PHP 5.3.x,
6143 in PHP 5.2.x,
2047 previously
All errors, warnings, and notices.
</entry>
<entry></entry>
</row>
</tbody>

View file

@ -119,19 +119,11 @@ ini_set('error_reporting', E_ALL);
<refsect1 role="notes">
&reftitle.notes;
<warning>
<simpara>
Most of <constant>E_STRICT</constant> errors are evaluated at the
compile time thus such errors are not reported in the file where
<link linkend="ini.error-reporting">error_reporting</link> is enhanced
to include <constant>E_STRICT</constant> errors (and vice versa).
</simpara>
</warning>
<tip>
<simpara>
Passing in the value <literal>-1</literal> will show every possible error,
even when new levels and constants are added in future PHP versions. The
<constant>E_ALL</constant> constant also behaves this way as of PHP 5.4.
behavior is equivalent to passing <constant>E_ALL</constant> constant.
</simpara>
</tip>
</refsect1>

View file

@ -162,18 +162,14 @@
<link linkend="ini.display-errors">display_errors</link> directive.
</para>
<para>
PHP 5.3 or later, the default value
The default value
is <constant>E_ALL</constant> &amp;
~<constant>E_NOTICE</constant> &amp;
~<constant>E_STRICT</constant> &amp;
~<constant>E_DEPRECATED</constant>. This setting does not
show <constant>E_NOTICE</constant>, <constant>E_STRICT</constant>
and <constant>E_DEPRECATED</constant> level errors. You may want
to show them during development.
Prior to PHP 5.3.0, the default value
is <constant>E_ALL</constant> &amp;
~<constant>E_NOTICE</constant> &amp;
~<constant>E_STRICT</constant>.
to show them during development.
</para>
<note>
<para>Enabling <constant>E_NOTICE</constant> during development has
@ -187,20 +183,6 @@
it is a string index for the array.
</para>
</note>
<note>
<para>
Prior to PHP 5.4.0 <constant>E_STRICT</constant> was not included within
<constant>E_ALL</constant>, so you would have to explicitly enable this kind of
error level in PHP &lt; 5.4.0. Enabling <constant>E_STRICT</constant> during development
has some benefits. STRICT messages provide suggestions that can help
ensure the best interoperability and forward compatibility of your code.
These messages may include things such as calling non-static methods
statically, defining properties in a compatible class definition while
defined in a used trait, and prior to PHP 5.3 some deprecated features
would issue <constant>E_STRICT</constant> errors such as assigning
objects by reference upon instantiation.
</para>
</note>
<note>
<title>PHP Constants outside of PHP</title>
<para>

View file

@ -89,7 +89,7 @@
<programlisting role="php">
<![CDATA[
<?php
error_reporting(E_ALL | E_STRICT);
/* data actually came from POST
$_POST = array(
'product_id' => 'libgd<script>',

View file

@ -79,7 +79,7 @@
<programlisting role="php">
<![CDATA[
<?php
error_reporting(E_ALL | E_STRICT);
$data = array(
'product_id' => 'libgd<script>',
'component' => '10',

View file

@ -45,15 +45,6 @@
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Emits an <constant>E_STRICT</constant> level error if a result set does
not exist, and suggests using <methodname>mysqli_stmt::more_results</methodname>
in these cases, before calling <methodname>mysqli_stmt::next_result</methodname>.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>

View file

@ -190,7 +190,6 @@
<programlisting role="php">
<![CDATA[
<?php
error_reporting(E_ALL | E_STRICT);
$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_bind($socket, '127.0.0.1', 1223);