#50242 [Opn->Asn]: Creating a DateTime object causes error_get_last() return value to reset
| From: | jani@php.net | Date: | Fri, 20 Nov 2009 18:00:09 +0000 |
| Subject: | #50242 [Opn->Asn]: Creating a DateTime object causes error_get_last() return value to reset | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-144876@lists.php.net to get a copy of this message | ||
ID: 50242
Updated by: jani@php.net
Reported By: jussi at growvc dot com
-Status: Open
+Status: Assigned
Bug Type: Date/time related
-Operating System: Linux
+Operating System: *
-PHP Version: 5.2.11
+PHP Version: 5.2
-Assigned To:
+Assigned To: derick
New Comment:
Happens only in PHP_5_2 branch.
Previous Comments:
------------------------------------------------------------------------
[2009-11-20 13:16:28] jussi at growvc dot com
Description:
------------
It seems that calling the DateTime class constructor causes an error
accumulated in error_get_last() to be cleared.
I am using a 64bit Linux (Ubuntu 9.10) with PHP 5.2.11 built by
dotdeb.org (unfortunately phpinfo() of their version doesn't give up
configure options). The problem reproduces with a default php.ini,
both as Apache module and on CLI.
I was also able do reproduce this on another system with another PHP
version (5.2.9, also a dotdeb build).
Reproduce code:
---------------
@trigger_error('foo');
echo (is_array(error_get_last())?'Error':'No error') . "\n";
$dt = new DateTime();
echo (is_array(error_get_last())?'Error':'No error') . "\n";
Expected result:
----------------
Error
Error
Actual result:
--------------
Error
No error
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50242&edit=1