Doc #63906 [Opn->Csd]: DateInterval::__construct throws undocumented Exception
| From: | oaass@php.net | Date: | Mon, 14 Jan 2013 09:19:13 +0000 |
| Subject: | Doc #63906 [Opn->Csd]: DateInterval::__construct throws undocumented Exception | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-9397@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63906&edit=1
ID: 63906
Updated by: oaass@php.net
Reported by: matt dot patterson at bookit dot com
Summary: DateInterval::__construct throws undocumented
Exception
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
-Assigned To:
+Assigned To: oaass
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2013-01-14 09:18:50] oaass@php.net
You can find documentation for Exception on http://php.net/class.exception
------------------------------------------------------------------------
[2013-01-04 19:16:59] matt dot patterson at bookit dot com
Description:
------------
---
From manual page: http://www.php.net/dateinterval.construct#refsect1-dateinterval.construct-parameters
---
DateInterval::__construct() throws \Exception when an invalid format is supplied, but this exception
is not documented anywhere in the PHP manual.
Test script:
---------------
<?php
try {
$di = new DateInterval('PTS'); // Or any other invalid format
} catch (Exception $e) {
echo $e->getMessage();
}
/*
* Prints:
* DateInterval::__construct() [<a
href='dateinterval.--construct'>dateinterval.--construct</a>]: Unknown or bad
format (PTS)
*/
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63906&edit=1