mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
insert again the description about assert functions in info.xml and update translations
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@30480 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
ab5b7eedd8
commit
c6361b7390
3 changed files with 127 additions and 4 deletions
|
@ -237,9 +237,9 @@
|
|||
<option>--with-ibm-db2<replaceable>=DIR</replaceable></option>
|
||||
</synopsis>
|
||||
<simpara>
|
||||
Enables IBM DB2 support. The parameter to this option is the
|
||||
DB2 base install directory and defaults to <filename
|
||||
class="directory">/home/db2inst1/sqllib</filename>.
|
||||
Enables IBM DB2 support. The parameter to this option is the
|
||||
DB2 base install directory and defaults to
|
||||
<filename class="directory">/home/db2inst1/sqllib</filename>.
|
||||
</simpara>
|
||||
<simpara>
|
||||
<ulink url="&url.ibmdb2;">IBM DB2 home page</ulink>
|
||||
|
|
|
@ -1,6 +1,129 @@
|
|||
<reference id="ref.info">
|
||||
<title>PHP options & information</title>
|
||||
<titleabbrev>PHP options/info</titleabbrev>
|
||||
|
||||
<refentry id="function.assert">
|
||||
<refnamediv>
|
||||
<refname>assert</refname>
|
||||
<refpurpose>Checks if assertion is false</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>assert</function></funcdef>
|
||||
<paramdef>string|bool <parameter>assertion</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<function>assert</function> will check the given
|
||||
<parameter>assertion</parameter> and take appropriate
|
||||
action if its result is <literal>false</literal>.
|
||||
</para>
|
||||
<para>
|
||||
If the <parameter>assertion</parameter> is given as a string it
|
||||
will be evaluated as PHP code by <function>assert</function>.
|
||||
The advantages of a string <parameter>assertion</parameter>
|
||||
are less overhead when assertion checking is off and messages
|
||||
containing the <parameter>assertion</parameter> expression when
|
||||
an assertion failes.
|
||||
</para>
|
||||
<para>
|
||||
Assertion should be used as a debugging feature only. You may
|
||||
use them for sanity-checks that test for conditions that should
|
||||
always be true and that indicate some programming errors if not
|
||||
or to check for the presence of certain features like extension
|
||||
functions or certain system limits and features.
|
||||
</para>
|
||||
<para>
|
||||
Assertions should not be used for normal runtime operations
|
||||
like input parameter checks. As a rule of thumb your code
|
||||
should always be able to work correct if assertion checking
|
||||
is not activated.
|
||||
</para>
|
||||
<para>
|
||||
The behavior of <function>assert</function> may be configured
|
||||
by <function>assert_options</function> or by .ini-settings
|
||||
described in that functions manual page.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.assert_options">
|
||||
<refnamediv>
|
||||
<refname>assert-options</refname>
|
||||
<refpurpose>Set/get the various assert flags</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>mixed <function>assert_options</function></funcdef>
|
||||
<paramdef>int <parameter>what</parameter></paramdef>
|
||||
<paramdef>mixed
|
||||
<parameter><optional>value</optional></parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
Using <function>assert_options</function> you may set the various
|
||||
<function>assert</function> control options or just query their
|
||||
current settings.
|
||||
</para>
|
||||
<table>
|
||||
<title>assert options</title>
|
||||
<tgroup cols="4">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>option</entry>
|
||||
<entry>ini-parameter</entry>
|
||||
<entry>default</entry>
|
||||
<entry>description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>ASSERT_ACTIVE</entry>
|
||||
<entry>assert.active</entry>
|
||||
<entry>1</entry>
|
||||
<entry>enable <function>assert</function> evaluation</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>ASSERT_WARNING</entry>
|
||||
<entry>assert.warning</entry>
|
||||
<entry>1</entry>
|
||||
<entry>issue a PHP warning for each failed assertion</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>ASSERT_BAIL</entry>
|
||||
<entry>assert.bail</entry>
|
||||
<entry>0</entry>
|
||||
<entry>terminate execution on failed assertions</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>ASSERT_QUIET_EVAL</entry>
|
||||
<entry>assert.quiet_eval</entry>
|
||||
<entry>0</entry>
|
||||
<entry>
|
||||
disable error_reporting during assertion expression
|
||||
evaluation
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>ASSERT_CALLBACK</entry>
|
||||
<entry>assert_callback</entry>
|
||||
<entry>(null)</entry>
|
||||
<entry>user function to call on failed assertions</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<para>
|
||||
<function>assert_options</function> will return the original
|
||||
setting of any option or <literal>false</literal> on errors.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.error-log">
|
||||
<refnamediv>
|
||||
|
|
|
@ -1108,7 +1108,7 @@ function showVar($var) {
|
|||
<programlisting role="php">
|
||||
<?php
|
||||
require("foolib.inc");
|
||||
/* the following will generate and error */
|
||||
/* the following will generate an error */
|
||||
require("utils.inc");
|
||||
$foo = array("1",array("complex","quaternion"));
|
||||
echo "this is requiring utils.inc again which is also\n";
|
||||
|
|
Loading…
Reference in a new issue