svn: /phpdoc/en/trunk/appendices/migration70/ new-features.xml

From: Date: Sun, 16 Aug 2015 17:23:15 +0000
Subject: svn: /phpdoc/en/trunk/appendices/migration70/ new-features.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-13609@lists.php.net to get a copy of this message
tpunt Sun, 16 Aug 2015 17:23:15 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=337503 Log: Update expectations section Changed paths: U phpdoc/en/trunk/appendices/migration70/new-features.xml Modified: phpdoc/en/trunk/appendices/migration70/new-features.xml =================================================================== --- phpdoc/en/trunk/appendices/migration70/new-features.xml 2015-08-16 17:22:21 UTC (rev 337502) +++ phpdoc/en/trunk/appendices/migration70/new-features.xml 2015-08-16 17:23:15 UTC (rev 337503) @@ -384,32 +384,20 @@ <title>Expectations</title> <para> - Expectations are backwards compatible enhancement to the older + Expectations are a backwards compatible enhancement to the older <function>assert</function> function. They enable for zero-cost assertions in production code, and provide the ability to throw custom exceptions on error. </para> <para> - <function>assert</function> has the following prototype: + As with the old API, if the first argument is a string, then it will be + evaluated. The second argument can either be a plain string (causing an + AssertionError to be triggered), or a custom exception object containing + an error message. </para> <informalexample> - <programlisting> -<![CDATA[ -void assert (mixed $expression [, mixed $message]); -]]> - </programlisting> - </informalexample> - - <para> - As with the old API, if <varname>$expression</varname> is a string, then it will be - evaluated. If the first argument is falsy, then the assertion fails. The - second argument can either be a plain string (causing an AssertionException - to be triggered), or a custom exception object containing an error message. - </para> - - <informalexample> <programlisting role="php"> <![CDATA[ <?php @@ -431,21 +419,45 @@ <para> With this feature comes two PHP.ini settings (along with their default values): - - zend.assertions = 1 - - assert.exception = 0 </para> + <itemizedlist> + <listitem> + <simpara> + <link linkend="ini.zend.assertions">zend.assertions</link> = 1 + </simpara> + </listitem> + <listitem> + <simpara> + <link linkend="ini.assert.exception">assert.exception</link> = 0 + </simpara> + </listitem> + </itemizedlist> <para> - zend.assertions has three values: - - 1 = generate and execute code (development mode) - - 0 = generate code and jump around at it at runtime - - -1 = don't generate any code (zero-cost, production mode) + <link linkend="ini.zend.assertions">zend.assertions</link> has three values: </para> + <itemizedlist> + <listitem> + <simpara> + 1 = generate and execute code (development mode) + </simpara> + </listitem> + <listitem> + <simpara> + 0 = generate code and jump around at it at runtime + </simpara> + </listitem> + <listitem> + <simpara> + -1 = don't generate any code (zero-cost, production mode) + </simpara> + </listitem> + </itemizedlist> <para> - assert.exception means that an exception is thrown when an assertion fails. - This is switched off by default to remain compatible with the old - <function>assert</function> function. + <link linkend="ini.assert.exception">assert.exception</link> means that an + exception is thrown when an assertion fails. This is switched off by default + to remain compatible with the old <function>assert</function> function. </para> </sect2> <sect2 xml:id="migration70.new-features.group-use-declarations">

« previous php.doc.cvs (#13609) next »