From: jussi at growvc dot com
Operating system: Linux
PHP version: 5.2.11
PHP Bug Type: Date/time related
Bug description: Creating a DateTime object causes error_get_last() return
value to reset
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 bug report at http://bugs.php.net/?id=50242&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=50242&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=50242&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=50242&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=50242&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=50242&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=50242&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=50242&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=50242&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=50242&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=50242&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=50242&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=50242&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=50242&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=50242&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50242&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50242&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=50242&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=50242&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=50242&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=50242&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=50242&r=mysqlcfg