Re: svn: /phpdoc/en/trunk/reference/datetime/datetime/ construct.xml
| From: | Peter Cowburn | Date: | Wed, 05 May 2010 08:01:07 +0000 |
| Subject: | Re: svn: /phpdoc/en/trunk/reference/datetime/datetime/ construct.xml | ||
| References: | 1 | Groups: | php.doc.cvs |
| Request: | Send a blank email to doc-cvs+get-6585@lists.php.net to get a copy of this message | ||
On 5 May 2010 04:45, Daniel Convissor <danielc@php.net> wrote:
> danielc Wed, 05 May 2010 03:45:09 +0000
>
> Revision: gÇgûu
> 7è,Uhttp://svn.php.net/viewvc?view=revision&revision=299010
>
> Log:
> Add error handling to basic example.
Surely now that is not one example written in two ways, but two
entirely different (and IMO not concise enough for the very first
example on the page) examples.
>
> Changed paths:
> U phpdoc/en/trunk/reference/datetime/datetime/construct.xml
>
> Modified: phpdoc/en/trunk/reference/datetime/datetime/construct.xml
> ===================================================================
> --- phpdoc/en/trunk/reference/datetime/datetime/construct.xml 2010-05-05 03:18:48 UTC (rev
> 299009)
> +++ phpdoc/en/trunk/reference/datetime/datetime/construct.xml 2010-05-05 03:45:09 UTC (rev
> 299010)
> @@ -94,7 +94,13 @@
> <programlisting role="php">
> <![CDATA[
> <?php
> -$date = new DateTime('2000-01-01');
> +try {
> + $date = new DateTime('2000-01-01');
> +} catch (Exception $e) {
> + echo $e->getMessage();
> + exit(1);
> +}
> +
> echo $date->format('Y-m-d');
> ?>
> ]]>
> @@ -104,6 +110,14 @@
> <![CDATA[
> <?php
> $date = date_create('2000-01-01');
> +if (!$date) {
> + $e = date_get_last_errors();
> + foreach ($e['errors'] as $error) {
> + echo "$error\n";
> + }
> + exit(1);
> +}
> +
> echo date_format($date, 'Y-m-d');
> ?>
> ]]>
>
>
> --
> PHP Documentation Commits Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>