php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #51317 Errors/Exceptions section is incorrect
Submitted: 2010-03-18 07:03 UTC Modified: 2010-10-20 07:09 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: laurenty at gmail dot com Assigned: kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.2.13 OS:
Private report: No CVE-ID: None
 [2010-03-18 07:03 UTC] laurenty at gmail dot com
Description:
------------
The section states that "Emits Exception in case of an error." but fails to mention that this behavior only applies to PHP 5 >= 5.3.0.
If 5.2, DateTime::__construct triggers an error, not an exception.

Test script:
---------------
<?php

set_error_handler('dummy');

try {
        $date = new DateTime('not a date');
}
catch (Exception $e) {
        die("\ncaught exception");
}

die("\ndying");

function dummy() {
        echo "\ndummy function";
}
?>



Expected result:
----------------
"caught exception"

Actual result:
--------------
"dummy"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-18 07:06 UTC] joey@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: joey
 [2010-03-18 07:06 UTC] joey@php.net
Appears to be a missing ChangeLog table on DateTime::__construct.
 [2010-10-20 07:08 UTC] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=304529
Log: Fixed bug #51317 (Errors/Exceptions section is incorrect)
 [2010-10-20 07:09 UTC] kalle@php.net
-Assigned To: joey +Assigned To: kalle
 [2010-10-20 07:09 UTC] kalle@php.net
-Status: Assigned +Status: Closed
 [2010-10-20 07:09 UTC] kalle@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2020-02-07 06:09 UTC] phpdocbot@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=3b77a371fd0f69a0ba5aa2b9cb1fa12e6b8f9746
Log: Fixed bug #51317 (Errors/Exceptions section is incorrect)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 03:01:30 2024 UTC